MCPcopy Create free account
hub / github.com/catboost/catboost / SetNonBlock

Function SetNonBlock

util/network/socket.cpp:1190–1207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1188#endif
1189
1190void SetNonBlock(SOCKET fd, bool value) {
1191#if defined(_unix_)
1192 #if defined(FIONBIO)
1193 Y_UNUSED(SetFlag); // shut up clang about unused function
1194 int nb = value;
1195
1196 if (ioctl(fd, FIONBIO, &nb) < 0) {
1197 ythrow TSystemError() << "ioctl failed";
1198 }
1199 #else
1200 SetFlag(fd, O_NONBLOCK, value);
1201 #endif
1202#elif defined(_win_)
1203 SetNonBlockSocket(fd, value);
1204#else
1205 #error todo
1206#endif
1207}
1208
1209bool IsNonBlock(SOCKET fd) {
1210#if defined(_unix_)

Callers 15

DoTestJoinFunction · 0.85
TStateMethod · 0.85
TOneSocketListenerMethod · 0.85
StartMethod · 0.85
TNotificationHandleMethod · 0.85
OnAcceptMethod · 0.85
TFdRequestQueueMethod · 0.85
TNehFdEventMethod · 0.85
OnAcceptMethod · 0.85
Y_UNIT_TESTFunction · 0.85
TSemaphorePipeMethod · 0.85

Calls 3

Y_UNUSEDFunction · 0.85
SetNonBlockSocketFunction · 0.85
SetFlagFunction · 0.70

Tested by 1