1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-09-01 06:21:57 +03:00

These examples no longer need to explictly set the socket to non-blocking state

as libssh2 itself will always do that by itself.
This commit is contained in:
Daniel Stenberg
2009-05-26 09:41:13 +02:00
parent 279d6dd82a
commit 1ffa2cb519
9 changed files with 28 additions and 161 deletions

View File

@@ -88,23 +88,6 @@ int main(int argc, char *argv[])
return -1;
}
/* We set the socket non-blocking. We do it after the connect just to
simplify the example code. */
#ifdef F_SETFL
/* FIXME: this can/should be done in a more portable manner */
rc = fcntl(sock, F_GETFL, 0);
fcntl(sock, F_SETFL, rc | O_NONBLOCK);
#elif defined(HAVE_IOCTLSOCKET)
ioctlsocket(sock, FIONBIO, &flag);
#else
#ifdef WIN32
u_long mode = 1;
ioctlsocket (sock, FIONBIO, &mode);
#else
#error "add support for setting the socket non-blocking here"
#endif
#endif
/* Create a session instance
*/
session = libssh2_session_init();