Cygwin: socket: move socket creation inside fhandler_socket class

Add fhandler_socket::socket method
Add fhandler_socket::set_socket_handle method, basically duplicating
what fdsock is doing.  This is the first step in getting rid of fdsock.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2018-02-14 22:21:58 +01:00
parent 7ae73be141
commit 913c6ca2c1
3 changed files with 167 additions and 47 deletions

View File

@@ -556,6 +556,10 @@ class fhandler_socket: public fhandler_base
{}
} status;
#ifdef __INSIDE_CYGWIN_NET__
int set_socket_handle (SOCKET sock);
#endif
public:
fhandler_socket ();
~fhandler_socket ();
@@ -576,6 +580,7 @@ class fhandler_socket: public fhandler_base
IMPLEMENT_STATUS_FLAG (conn_state, connect_state)
IMPLEMENT_STATUS_FLAG (bool, no_getpeereid)
int socket (int af, int type, int protocol, int flags);
int bind (const struct sockaddr *name, int namelen);
int connect (const struct sockaddr *name, int namelen);
int listen (int backlog);