From 7483649514ed2049deaf59077dbb77c915ba22a0 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 15 Sep 2010 18:25:18 +1000 Subject: win32: reimplement connect() connect() now returns a socket handle, i.e. a HANDLE. This kind of handle works with read()/write(). But on the other hand, FILE* functions are dead because they are not crt file handles?? --- win32/net.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'win32') diff --git a/win32/net.c b/win32/net.c index 98204b99c..eadda6b69 100644 --- a/win32/net.c +++ b/win32/net.c @@ -45,3 +45,10 @@ int mingw_socket(int domain, int type, int protocol) } return sockfd; } + +#undef connect +int mingw_connect(int sockfd, struct sockaddr *sa, size_t sz) +{ + SOCKET s = (SOCKET)_get_osfhandle(sockfd); + return connect(s, sa, sz); +} -- cgit v1.2.3-55-g6feb