2
|
1 |
/*
|
|
2 |
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation. Sun designates this
|
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
|
9 |
* by Sun in the LICENSE file that accompanied this code.
|
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
* have any questions.
|
|
24 |
*/
|
|
25 |
#include <windows.h>
|
|
26 |
#include <winsock2.h>
|
|
27 |
#include "jni.h"
|
|
28 |
#include "net_util.h"
|
|
29 |
#include "java_net_DualStackPlainSocketImpl.h"
|
|
30 |
|
|
31 |
#define SET_BLOCKING 0
|
|
32 |
#define SET_NONBLOCKING 1
|
|
33 |
|
|
34 |
static jclass isa_class; /* java.net.InetSocketAddress */
|
|
35 |
static jmethodID isa_ctorID; /* InetSocketAddress(InetAddress, int) */
|
|
36 |
|
|
37 |
/*
|
|
38 |
* Class: java_net_DualStackPlainSocketImpl
|
|
39 |
* Method: initIDs
|
|
40 |
* Signature: ()V
|
|
41 |
*/
|
|
42 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_initIDs
|
|
43 |
(JNIEnv *env, jclass clazz) {
|
|
44 |
|
|
45 |
jclass cls = (*env)->FindClass(env, "java/net/InetSocketAddress");
|
|
46 |
isa_class = (*env)->NewGlobalRef(env, cls);
|
|
47 |
isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
|
|
48 |
"(Ljava/net/InetAddress;I)V");
|
|
49 |
|
|
50 |
// implement read timeout with select.
|
|
51 |
isRcvTimeoutSupported = 0;
|
|
52 |
}
|
|
53 |
|
|
54 |
/*
|
|
55 |
* Class: java_net_DualStackPlainSocketImpl
|
|
56 |
* Method: socket0
|
|
57 |
* Signature: (ZZ)I
|
|
58 |
*/
|
|
59 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_socket0
|
|
60 |
(JNIEnv *env, jclass clazz, jboolean stream, jboolean v6Only /*unused*/) {
|
|
61 |
int fd, rv, opt=0;
|
|
62 |
|
|
63 |
fd = NET_Socket(AF_INET6, (stream ? SOCK_STREAM : SOCK_DGRAM), 0);
|
|
64 |
if (fd == INVALID_SOCKET) {
|
|
65 |
NET_ThrowNew(env, WSAGetLastError(), "create");
|
|
66 |
return -1;
|
|
67 |
}
|
|
68 |
|
|
69 |
rv = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &opt, sizeof(opt));
|
|
70 |
if (rv == SOCKET_ERROR) {
|
|
71 |
NET_ThrowNew(env, WSAGetLastError(), "create");
|
|
72 |
}
|
|
73 |
|
|
74 |
SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE);
|
|
75 |
|
|
76 |
return fd;
|
|
77 |
}
|
|
78 |
|
|
79 |
/*
|
|
80 |
* Class: java_net_DualStackPlainSocketImpl
|
|
81 |
* Method: bind0
|
|
82 |
* Signature: (ILjava/net/InetAddress;I)V
|
|
83 |
*/
|
|
84 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_bind0
|
|
85 |
(JNIEnv *env, jclass clazz, jint fd, jobject iaObj, jint port) {
|
|
86 |
SOCKETADDRESS sa;
|
|
87 |
int rv;
|
|
88 |
int sa_len = sizeof(sa);
|
|
89 |
|
|
90 |
if (NET_InetAddressToSockaddr(env, iaObj, port, (struct sockaddr *)&sa,
|
|
91 |
&sa_len, JNI_TRUE) != 0) {
|
|
92 |
return;
|
|
93 |
}
|
|
94 |
|
|
95 |
rv = NET_Bind(fd, (struct sockaddr *)&sa, sa_len);
|
|
96 |
|
|
97 |
if (rv == SOCKET_ERROR)
|
|
98 |
NET_ThrowNew(env, WSAGetLastError(), "JVM_Bind");
|
|
99 |
}
|
|
100 |
|
|
101 |
/*
|
|
102 |
* Class: java_net_DualStackPlainSocketImpl
|
|
103 |
* Method: connect0
|
|
104 |
* Signature: (ILjava/net/InetAddress;I)I
|
|
105 |
*/
|
|
106 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_connect0
|
|
107 |
(JNIEnv *env, jclass clazz, jint fd, jobject iaObj, jint port) {
|
|
108 |
SOCKETADDRESS sa;
|
|
109 |
int rv;
|
|
110 |
int sa_len = sizeof(sa);
|
|
111 |
|
|
112 |
if (NET_InetAddressToSockaddr(env, iaObj, port, (struct sockaddr *)&sa,
|
|
113 |
&sa_len, JNI_TRUE) != 0) {
|
|
114 |
return -1;
|
|
115 |
}
|
|
116 |
|
|
117 |
rv = connect(fd, (struct sockaddr *)&sa, sa_len);
|
|
118 |
if (rv == SOCKET_ERROR) {
|
|
119 |
int err = WSAGetLastError();
|
|
120 |
if (err == WSAEWOULDBLOCK) {
|
|
121 |
return java_net_DualStackPlainSocketImpl_WOULDBLOCK;
|
|
122 |
} else if (err == WSAEADDRNOTAVAIL) {
|
|
123 |
JNU_ThrowByName(env, JNU_JAVANETPKG "ConnectException",
|
|
124 |
"connect: Address is invalid on local machine, or port is not valid on remote machine");
|
|
125 |
} else {
|
|
126 |
NET_ThrowNew(env, err, "connect");
|
|
127 |
}
|
|
128 |
return -1; // return value not important.
|
|
129 |
}
|
|
130 |
return rv;
|
|
131 |
}
|
|
132 |
|
|
133 |
/*
|
|
134 |
* Class: java_net_DualStackPlainSocketImpl
|
|
135 |
* Method: waitForConnect
|
|
136 |
* Signature: (II)V
|
|
137 |
*/
|
|
138 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_waitForConnect
|
|
139 |
(JNIEnv *env, jclass clazz, jint fd, jint timeout) {
|
|
140 |
int rv, retry;
|
|
141 |
int optlen = sizeof(rv);
|
|
142 |
fd_set wr, ex;
|
|
143 |
struct timeval t;
|
|
144 |
|
|
145 |
FD_ZERO(&wr);
|
|
146 |
FD_ZERO(&ex);
|
|
147 |
FD_SET(fd, &wr);
|
|
148 |
FD_SET(fd, &ex);
|
|
149 |
t.tv_sec = timeout / 1000;
|
|
150 |
t.tv_usec = (timeout % 1000) * 1000;
|
|
151 |
|
|
152 |
/*
|
|
153 |
* Wait for timeout, connection established or
|
|
154 |
* connection failed.
|
|
155 |
*/
|
|
156 |
rv = select(fd+1, 0, &wr, &ex, &t);
|
|
157 |
|
|
158 |
/*
|
|
159 |
* Timeout before connection is established/failed so
|
|
160 |
* we throw exception and shutdown input/output to prevent
|
|
161 |
* socket from being used.
|
|
162 |
* The socket should be closed immediately by the caller.
|
|
163 |
*/
|
|
164 |
if (rv == 0) {
|
|
165 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
|
|
166 |
"connect timed out");
|
|
167 |
shutdown( fd, SD_BOTH );
|
|
168 |
return;
|
|
169 |
}
|
|
170 |
|
|
171 |
/*
|
|
172 |
* Socket is writable or error occured. On some Windows editions
|
|
173 |
* the socket will appear writable when the connect fails so we
|
|
174 |
* check for error rather than writable.
|
|
175 |
*/
|
|
176 |
if (!FD_ISSET(fd, &ex)) {
|
|
177 |
return; /* connection established */
|
|
178 |
}
|
|
179 |
|
|
180 |
/*
|
|
181 |
* Connection failed. The logic here is designed to work around
|
|
182 |
* bug on Windows NT whereby using getsockopt to obtain the
|
|
183 |
* last error (SO_ERROR) indicates there is no error. The workaround
|
|
184 |
* on NT is to allow winsock to be scheduled and this is done by
|
|
185 |
* yielding and retrying. As yielding is problematic in heavy
|
|
186 |
* load conditions we attempt up to 3 times to get the error reason.
|
|
187 |
*/
|
|
188 |
for (retry=0; retry<3; retry++) {
|
|
189 |
NET_GetSockOpt(fd, SOL_SOCKET, SO_ERROR,
|
|
190 |
(char*)&rv, &optlen);
|
|
191 |
if (rv) {
|
|
192 |
break;
|
|
193 |
}
|
|
194 |
Sleep(0);
|
|
195 |
}
|
|
196 |
|
|
197 |
if (rv == 0) {
|
|
198 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
|
|
199 |
"Unable to establish connection");
|
|
200 |
} else {
|
|
201 |
NET_ThrowNew(env, rv, "connect");
|
|
202 |
}
|
|
203 |
}
|
|
204 |
|
|
205 |
/*
|
|
206 |
* Class: java_net_DualStackPlainSocketImpl
|
|
207 |
* Method: localPort0
|
|
208 |
* Signature: (I)I
|
|
209 |
*/
|
|
210 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_localPort0
|
|
211 |
(JNIEnv *env, jclass clazz, jint fd) {
|
|
212 |
SOCKETADDRESS sa;
|
|
213 |
int len = sizeof(sa);
|
|
214 |
|
|
215 |
if (getsockname(fd, (struct sockaddr *)&sa, &len) == SOCKET_ERROR) {
|
|
216 |
if (WSAGetLastError() == WSAENOTSOCK) {
|
|
217 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
|
|
218 |
"Socket closed");
|
|
219 |
} else {
|
|
220 |
NET_ThrowNew(env, WSAGetLastError(), "getsockname failed");
|
|
221 |
}
|
|
222 |
return -1;
|
|
223 |
}
|
|
224 |
return (int) ntohs((u_short)GET_PORT(&sa));
|
|
225 |
}
|
|
226 |
|
|
227 |
/*
|
|
228 |
* Class: java_net_DualStackPlainSocketImpl
|
|
229 |
* Method: localAddress
|
|
230 |
* Signature: (ILjava/net/InetAddressContainer;)V
|
|
231 |
*/
|
|
232 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_localAddress
|
|
233 |
(JNIEnv *env, jclass clazz, jint fd, jobject iaContainerObj) {
|
|
234 |
int port;
|
|
235 |
SOCKETADDRESS sa;
|
|
236 |
int len = sizeof(sa);
|
|
237 |
jobject iaObj;
|
|
238 |
jclass iaContainerClass;
|
|
239 |
jfieldID iaFieldID;
|
|
240 |
|
|
241 |
if (getsockname(fd, (struct sockaddr *)&sa, &len) == SOCKET_ERROR) {
|
|
242 |
NET_ThrowNew(env, WSAGetLastError(), "Error getting socket name");
|
|
243 |
return;
|
|
244 |
}
|
|
245 |
iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
|
|
246 |
CHECK_NULL(iaObj);
|
|
247 |
|
|
248 |
iaContainerClass = (*env)->GetObjectClass(env, iaContainerObj);
|
|
249 |
iaFieldID = (*env)->GetFieldID(env, iaContainerClass, "addr", "Ljava/net/InetAddress;");
|
|
250 |
CHECK_NULL(iaFieldID);
|
|
251 |
(*env)->SetObjectField(env, iaContainerObj, iaFieldID, iaObj);
|
|
252 |
}
|
|
253 |
|
|
254 |
|
|
255 |
/*
|
|
256 |
* Class: java_net_DualStackPlainSocketImpl
|
|
257 |
* Method: listen0
|
|
258 |
* Signature: (II)V
|
|
259 |
*/
|
|
260 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_listen0
|
|
261 |
(JNIEnv *env, jclass clazz, jint fd, jint backlog) {
|
|
262 |
if (listen(fd, backlog) == SOCKET_ERROR) {
|
|
263 |
NET_ThrowNew(env, WSAGetLastError(), "listen failed");
|
|
264 |
}
|
|
265 |
}
|
|
266 |
|
|
267 |
/*
|
|
268 |
* Class: java_net_DualStackPlainSocketImpl
|
|
269 |
* Method: accept0
|
|
270 |
* Signature: (I[Ljava/net/InetSocketAddress;)I
|
|
271 |
*/
|
|
272 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_accept0
|
|
273 |
(JNIEnv *env, jclass clazz, jint fd, jobjectArray isaa) {
|
|
274 |
int newfd, port=0;
|
|
275 |
jobject isa;
|
|
276 |
jobject ia;
|
|
277 |
SOCKETADDRESS sa;
|
|
278 |
int len = sizeof(sa);
|
|
279 |
|
|
280 |
memset((char *)&sa, 0, len);
|
|
281 |
newfd = accept(fd, (struct sockaddr *)&sa, &len);
|
|
282 |
|
|
283 |
if (newfd == INVALID_SOCKET) {
|
|
284 |
if (WSAGetLastError() == -2) {
|
|
285 |
JNU_ThrowByName(env, JNU_JAVAIOPKG "InterruptedIOException",
|
|
286 |
"operation interrupted");
|
|
287 |
} else {
|
|
288 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
|
|
289 |
"socket closed");
|
|
290 |
}
|
|
291 |
return -1;
|
|
292 |
}
|
|
293 |
|
|
294 |
ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
|
|
295 |
isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
|
|
296 |
(*env)->SetObjectArrayElement(env, isaa, 0, isa);
|
|
297 |
|
|
298 |
return newfd;
|
|
299 |
}
|
|
300 |
|
|
301 |
/*
|
|
302 |
* Class: java_net_DualStackPlainSocketImpl
|
|
303 |
* Method: waitForNewConnection
|
|
304 |
* Signature: (II)V
|
|
305 |
*/
|
|
306 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_waitForNewConnection
|
|
307 |
(JNIEnv *env, jclass clazz, jint fd, jint timeout) {
|
|
308 |
int rv;
|
|
309 |
|
|
310 |
rv = NET_Timeout(fd, timeout);
|
|
311 |
if (rv == 0) {
|
|
312 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
|
|
313 |
"Accept timed out");
|
|
314 |
} else if (rv == -1) {
|
|
315 |
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "socket closed");
|
|
316 |
} else if (rv == -2) {
|
|
317 |
JNU_ThrowByName(env, JNU_JAVAIOPKG "InterruptedIOException",
|
|
318 |
"operation interrupted");
|
|
319 |
}
|
|
320 |
}
|
|
321 |
|
|
322 |
/*
|
|
323 |
* Class: java_net_DualStackPlainSocketImpl
|
|
324 |
* Method: available0
|
|
325 |
* Signature: (I)I
|
|
326 |
*/
|
|
327 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_available0
|
|
328 |
(JNIEnv *env, jclass clazz, jint fd) {
|
|
329 |
jint available = -1;
|
|
330 |
|
|
331 |
if ((ioctlsocket(fd, FIONREAD, &available)) == SOCKET_ERROR) {
|
|
332 |
NET_ThrowNew(env, WSAGetLastError(), "socket available");
|
|
333 |
}
|
|
334 |
|
|
335 |
return available;
|
|
336 |
}
|
|
337 |
|
|
338 |
/*
|
|
339 |
* Class: java_net_DualStackPlainSocketImpl
|
|
340 |
* Method: close0
|
|
341 |
* Signature: (I)V
|
|
342 |
*/
|
|
343 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_close0
|
|
344 |
(JNIEnv *env, jclass clazz, jint fd) {
|
|
345 |
NET_SocketClose(fd);
|
|
346 |
}
|
|
347 |
|
|
348 |
/*
|
|
349 |
* Class: java_net_DualStackPlainSocketImpl
|
|
350 |
* Method: shutdown0
|
|
351 |
* Signature: (II)V
|
|
352 |
*/
|
|
353 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_shutdown0
|
|
354 |
(JNIEnv *env, jclass clazz, jint fd, jint howto) {
|
|
355 |
shutdown(fd, howto);
|
|
356 |
}
|
|
357 |
|
|
358 |
|
|
359 |
/*
|
|
360 |
* Class: java_net_DualStackPlainSocketImpl
|
|
361 |
* Method: setIntOption
|
|
362 |
* Signature: (III)V
|
|
363 |
*/
|
|
364 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_setIntOption
|
|
365 |
(JNIEnv *env, jclass clazz, jint fd, jint cmd, jint value) {
|
|
366 |
|
|
367 |
int level, opt;
|
|
368 |
struct linger linger;
|
|
369 |
char *parg;
|
|
370 |
int arglen;
|
|
371 |
|
|
372 |
if (NET_MapSocketOption(cmd, &level, &opt) < 0) {
|
|
373 |
JNU_ThrowByNameWithLastError(env,
|
|
374 |
JNU_JAVANETPKG "SocketException",
|
|
375 |
"Invalid option");
|
|
376 |
return;
|
|
377 |
}
|
|
378 |
|
|
379 |
if (opt == java_net_SocketOptions_SO_LINGER) {
|
|
380 |
parg = (char *)&linger;
|
|
381 |
arglen = sizeof(linger);
|
|
382 |
if (value >= 0) {
|
|
383 |
linger.l_onoff = 1;
|
|
384 |
linger.l_linger = (unsigned short)value;
|
|
385 |
} else {
|
|
386 |
linger.l_onoff = 0;
|
|
387 |
linger.l_linger = 0;
|
|
388 |
}
|
|
389 |
} else {
|
|
390 |
parg = (char *)&value;
|
|
391 |
arglen = sizeof(value);
|
|
392 |
}
|
|
393 |
|
|
394 |
if (NET_SetSockOpt(fd, level, opt, parg, arglen) < 0) {
|
|
395 |
NET_ThrowNew(env, WSAGetLastError(), "setsockopt");
|
|
396 |
}
|
|
397 |
}
|
|
398 |
|
|
399 |
/*
|
|
400 |
* Class: java_net_DualStackPlainSocketImpl
|
|
401 |
* Method: getIntOption
|
|
402 |
* Signature: (II)I
|
|
403 |
*/
|
|
404 |
JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_getIntOption
|
|
405 |
(JNIEnv *env, jclass clazz, jint fd, jint cmd) {
|
|
406 |
|
|
407 |
int level, opt;
|
|
408 |
int result=0;
|
|
409 |
struct linger linger;
|
|
410 |
char *arg;
|
|
411 |
int arglen;
|
|
412 |
|
|
413 |
if (NET_MapSocketOption(cmd, &level, &opt) < 0) {
|
|
414 |
JNU_ThrowByNameWithLastError(env,
|
|
415 |
JNU_JAVANETPKG "SocketException",
|
|
416 |
"Unsupported socket option");
|
|
417 |
return -1;
|
|
418 |
}
|
|
419 |
|
|
420 |
if (opt == java_net_SocketOptions_SO_LINGER) {
|
|
421 |
arg = (char *)&linger;
|
|
422 |
arglen = sizeof(linger);
|
|
423 |
} else {
|
|
424 |
arg = (char *)&result;
|
|
425 |
arglen = sizeof(result);
|
|
426 |
}
|
|
427 |
|
|
428 |
if (NET_GetSockOpt(fd, level, opt, arg, &arglen) < 0) {
|
|
429 |
NET_ThrowNew(env, WSAGetLastError(), "getsockopt");
|
|
430 |
return -1;
|
|
431 |
}
|
|
432 |
|
|
433 |
if (opt == java_net_SocketOptions_SO_LINGER)
|
|
434 |
return linger.l_onoff ? linger.l_linger : -1;
|
|
435 |
else
|
|
436 |
return result;
|
|
437 |
}
|
|
438 |
|
|
439 |
|
|
440 |
/*
|
|
441 |
* Class: java_net_DualStackPlainSocketImpl
|
|
442 |
* Method: sendOOB
|
|
443 |
* Signature: (II)V
|
|
444 |
*/
|
|
445 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_sendOOB
|
|
446 |
(JNIEnv *env, jclass clazz, jint fd, jint data) {
|
|
447 |
jint n;
|
|
448 |
unsigned char d = (unsigned char) data & 0xff;
|
|
449 |
|
|
450 |
n = send(fd, (char *)&data, 1, MSG_OOB);
|
|
451 |
if (n == JVM_IO_ERR) {
|
|
452 |
NET_ThrowNew(env, WSAGetLastError(), "send");
|
|
453 |
} else if (n == JVM_IO_INTR) {
|
|
454 |
JNU_ThrowByName(env, "java/io/InterruptedIOException", 0);
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
|
458 |
/*
|
|
459 |
* Class: java_net_DualStackPlainSocketImpl
|
|
460 |
* Method: configureBlocking
|
|
461 |
* Signature: (IZ)V
|
|
462 |
*/
|
|
463 |
JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_configureBlocking
|
|
464 |
(JNIEnv *env, jclass clazz, jint fd, jboolean blocking) {
|
|
465 |
u_long arg;
|
|
466 |
int result;
|
|
467 |
|
|
468 |
if (blocking == JNI_TRUE) {
|
|
469 |
arg = SET_BLOCKING; // 0
|
|
470 |
} else {
|
|
471 |
arg = SET_NONBLOCKING; // 1
|
|
472 |
}
|
|
473 |
|
|
474 |
result = ioctlsocket(fd, FIONBIO, &arg);
|
|
475 |
if (result == SOCKET_ERROR) {
|
|
476 |
NET_ThrowNew(env, WSAGetLastError(), "configureBlocking");
|
|
477 |
}
|
|
478 |
}
|