Update to Visual Studio 2017.
This commit is contained in:
parent
648d81281f
commit
288219fd6b
10 changed files with 151 additions and 178 deletions
4
src/wsocket.c
Normal file → Executable file
4
src/wsocket.c
Normal file → Executable file
|
@ -131,11 +131,11 @@ int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {
|
|||
/* we wait until something happens */
|
||||
err = socket_waitfd(ps, WAITFD_C, tm);
|
||||
if (err == IO_CLOSED) {
|
||||
int len = sizeof(err);
|
||||
int elen = sizeof(err);
|
||||
/* give windows time to set the error (yes, disgusting) */
|
||||
Sleep(10);
|
||||
/* find out why we failed */
|
||||
getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len);
|
||||
getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &elen);
|
||||
/* we KNOW there was an error. if 'why' is 0, we will return
|
||||
* "unknown error", but it's not really our fault */
|
||||
return err > 0? err: IO_UNKNOWN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue