Skip to content
Snippets Groups Projects
Commit b883bedf authored by rswindell's avatar rswindell
Browse files

Fixed use of select() in nonblocking_connect().

parent d9706a79
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
...@@ -378,7 +378,7 @@ int nonblocking_connect(SOCKET sock, struct sockaddr* addr, size_t size, unsigne ...@@ -378,7 +378,7 @@ int nonblocking_connect(SOCKET sock, struct sockaddr* addr, size_t size, unsigne
tv.tv_usec = 0; tv.tv_usec = 0;
FD_ZERO(&socket_set); FD_ZERO(&socket_set);
FD_SET(sock,&socket_set); FD_SET(sock,&socket_set);
if(select(sock,NULL,&socket_set,NULL,&tv)==1) if(select(sock+1,NULL,&socket_set,NULL,&tv)==1)
getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&result, &optlen); getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&result, &optlen);
} }
return result; return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment