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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user