MCPcopy Create free account
hub / github.com/Tencent/libco / SetNonBlock

Function SetNonBlock

example_echosvr.cpp:53–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51static stack<task_t*> g_readwrite;
52static int g_listen_fd = -1;
53static int SetNonBlock(int iSock)
54{
55 int iFlags;
56
57 iFlags = fcntl(iSock, F_GETFL, 0);
58 iFlags |= O_NONBLOCK;
59 iFlags |= O_NDELAY;
60 int ret = fcntl(iSock, F_SETFL, iFlags);
61 return ret;
62}
63
64static void *readwrite_routine( void *arg )
65{

Callers 2

accept_routineFunction · 0.70
mainFunction · 0.70

Calls 1

fcntlFunction · 0.85

Tested by

no test coverage detected