author | michaelm |
Tue, 29 Oct 2019 19:55:34 +0000 | |
branch | unixdomainchannels |
changeset 58848 | c3df0f8b6d93 |
parent 58801 | 119ac9128c1b |
permissions | -rw-r--r-- |
2 | 1 |
/* |
54154
1caf2daef7cf
8220738: (sc) Move ServerSocketChannelImpl remaining native method to Net
alanb
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
22604
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
26 |
#include <winsock2.h> |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
27 |
|
2 | 28 |
#include "jni.h" |
29 |
||
5804
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
30 |
/** |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
31 |
* The maximum buffer size for WSASend/WSARecv. Microsoft recommendation for |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
32 |
* blocking operations is to use buffers no larger than 64k. We need the |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
33 |
* maximum to be less than 128k to support asynchronous close on Windows |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
34 |
* Server 2003 and newer editions of Windows. |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
35 |
*/ |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
36 |
#define MAX_BUFFER_SIZE ((128*1024)-1) |
faf9bd47d6ce
6395224: (so) SocketChannel writer blocked on large buffer is not preempted by close method (vista)
alanb
parents:
5506
diff
changeset
|
37 |
|
58848
c3df0f8b6d93
second part of cleanup reducing number of files touched in main line
michaelm
parents:
58801
diff
changeset
|
38 |
jint fdval(JNIEnv *env, jobject fdo); |
c3df0f8b6d93
second part of cleanup reducing number of files touched in main line
michaelm
parents:
58801
diff
changeset
|
39 |
void setfdval(JNIEnv *env, jobject fdo, jint val); |
2 | 40 |
jlong handleval(JNIEnv *env, jobject fdo); |
41 |
jint convertReturnVal(JNIEnv *env, jint n, jboolean r); |
|
42 |
jlong convertLongReturnVal(JNIEnv *env, jlong n, jboolean r); |
|
43 |
jboolean purgeOutstandingICMP(JNIEnv *env, jclass clazz, jint fd); |
|
58848
c3df0f8b6d93
second part of cleanup reducing number of files touched in main line
michaelm
parents:
58801
diff
changeset
|
44 |
jint handleSocketError(JNIEnv *env, int errorValue); |
2 | 45 |
|
46 |
#ifdef _WIN64 |
|
47 |
||
48 |
struct iovec { |
|
49 |
jlong iov_base; |
|
50 |
jint iov_len; |
|
51 |
}; |
|
52 |
||
53 |
#else |
|
54 |
||
55 |
struct iovec { |
|
56 |
jint iov_base; |
|
57 |
jint iov_len; |
|
58 |
}; |
|
59 |
||
60 |
#endif |
|
22604
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
61 |
|
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
62 |
#ifndef POLLIN |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
63 |
/* WSAPoll()/WSAPOLLFD and the corresponding constants are only defined */ |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
64 |
/* in Windows Vista / Windows Server 2008 and later. If we are on an */ |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
65 |
/* older release we just use the Solaris constants as this was previously */ |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
66 |
/* done in PollArrayWrapper.java. */ |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
67 |
#define POLLIN 0x0001 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
68 |
#define POLLOUT 0x0004 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
69 |
#define POLLERR 0x0008 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
70 |
#define POLLHUP 0x0010 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
71 |
#define POLLNVAL 0x0020 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
72 |
#define POLLCONN 0x0002 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
73 |
#else |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
74 |
/* POLLCONN must not equal any of the other constants (see winsock2.h). */ |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
75 |
#define POLLCONN 0x2000 |
9b394795e216
8031997: PPC64: Make the various POLL constants system dependant
simonis
parents:
14342
diff
changeset
|
76 |
#endif |