non blocking
This commit is contained in:
parent
280d1d7366
commit
44e5ab7f7d
@ -152,7 +152,13 @@ namespace ix
|
||||
{
|
||||
int flag = 1;
|
||||
setsockopt(_sockfd, IPPROTO_TCP, TCP_NODELAY, (char*) &flag, sizeof(flag)); // Disable Nagle's algorithm
|
||||
|
||||
#ifdef _WIN32
|
||||
unsigned long nonblocking = 1;
|
||||
ioctlsocket(fd, FIONBIO, &nonblocking);
|
||||
#else
|
||||
fcntl(_sockfd, F_SETFL, O_NONBLOCK); // make socket non blocking
|
||||
#endif
|
||||
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int value = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user