MCPcopy Create free account
hub / github.com/ReadyTalk/avian / setBlocking

Function setBlocking

classpath/java-nio.cpp:193–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193bool setBlocking(JNIEnv* e, int d, bool blocking)
194{
195#ifdef PLATFORM_WINDOWS
196 u_long a = (blocking ? 0 : 1);
197 int r = ioctlsocket(d, FIONBIO, &a);
198 if (r != 0) {
199 throwIOException(e);
200 return false;
201 }
202#else
203 int r = fcntl(d,
204 F_SETFL,
205 (blocking ? (fcntl(d, F_GETFL) & (~O_NONBLOCK))
206 : (fcntl(d, F_GETFL) | O_NONBLOCK)));
207 if (r < 0) {
208 throwIOException(e);
209 return false;
210 }
211#endif
212 return true;
213}
214
215bool setTcpNoDelay(JNIEnv* e, int d, bool on)
216{

Callers 2

PipeMethod · 0.85

Calls 1

throwIOExceptionFunction · 0.85

Tested by

no test coverage detected