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

Function SetNonBlockSocket

util/network/socket.cpp:1165–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163
1164#if defined(_win_)
1165static inline void SetNonBlockSocket(SOCKET fd, int value) {
1166 unsigned long inbuf = value;
1167 unsigned long outbuf = 0;
1168 DWORD written = 0;
1169
1170 if (!inbuf) {
1171 WSAEventSelect(fd, nullptr, 0);
1172 }
1173
1174 if (WSAIoctl(fd, FIONBIO, &inbuf, sizeof(inbuf), &outbuf, sizeof(outbuf), &written, 0, 0) == SOCKET_ERROR) {
1175 ythrow TSystemError() << "can not set non block socket state";
1176 }
1177}
1178
1179static inline bool IsNonBlockSocket(SOCKET fd) {
1180 unsigned long buf = 0;

Callers 1

SetNonBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected