mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
use non-blocking mode to accept connections
This commit is contained in:
parent
96a8613dbc
commit
a2f63bfec0
2 changed files with 24 additions and 0 deletions
|
@ -1864,6 +1864,23 @@ static Class tcpPortClass;
|
|||
{
|
||||
#if defined(_WIN32)
|
||||
int rc;
|
||||
|
||||
#else
|
||||
int e;
|
||||
if ((e = fcntl(desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
e |= NBLK_OPT;
|
||||
if (fcntl(desc, F_SETFL, e) < 0)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode on %d - %@",
|
||||
desc, [NSError _last]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to get/set non-blocking mode on %d - %@",
|
||||
desc, [NSError _last]);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Set up the listening descriptor and the actual TCP port
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue