typedef typename _Impl::sockaddr_t sockaddr_t;
typedef typename _Impl::sockaddr_in_t sockaddr_in_t;
typedef typename _Impl::addrinfo_t addrinfo_t;
+ typedef typename _Impl::fd_set_t fd_set_t, fdset_t;
protected:
_Impl m_impl;
}
return true;
}
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ int select(int fdset_max_plus_one,
+ fdset_t* readable_check_fdset,
+ fdset_t* writable_check_fdset,
+ fdset_t* exception_check_fdset, long timeout_sec, long timeout_usec=0 )
+ {
+ return m_impl.select(fdset_max_plus_one,
+ readable_check_fdset, writable_check_fdset, exception_check_fdset,
+ timeout_sec, timeout_usec);
+ }
+ bool is_connected()
+ {
+
+ }
bool is_available_socket()
{
- return (m_socket != _Impl::invalid_socket);
+ //return (m_socket != _Impl::invalid_socket);
+ /*if ( m_socket == _Impl::invalid_socket )
+ return false;*/
+ return is_connected();
}
bool is_available(){ return is_available_socket(); }
typedef struct ::sockaddr_in sockaddr_in_t;
typedef struct ::addrinfo addrinfo_t;
typedef ::SOCKET socket_t;
+ typedef ::fd_set fd_set_t, fdset_t;
private:
//WSADATA* m_wsaInfo;
return _apiret_WSAle( ::closesocket(s) );
}
+ // select()
+ int select(socket_t s,
+ fdset_t *readfds, fdset_t *writefds, fdset_t *exceptfds,
+ long timeout_sec, long timeout_usec)
+ {
+ struct ::timeval tv;
+ tv.tv_sec = timeout_sec;
+ tv.tv_usec = timeout_usec;
+
+ int ret = ::select(s, readfds, writefds, exceptfds, tv);
+ _WSAle_update();
+ return ret;
+ }
+
////////////////////////////////////////////////////////////////
// recv