summaryrefslogtreecommitdiff
path: root/libjava/gnu/java/nio/ServerSocketChannelImpl.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2002-11-29 09:57:05 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2002-11-29 09:57:05 +0000
commita4536c7a944127cec1e9e20f57afb5f20c8ba068 (patch)
treeadcaaa3a449aead6635ab9800c8f3f5ba50315d9 /libjava/gnu/java/nio/ServerSocketChannelImpl.java
parent45596747cafe87cb8884a424359a9cb868977273 (diff)
2002-11-29 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/DatagramChannelImpl: (fd): New member variable to store file descriptor of socket. * gnu/java/nio/SelectionKeyImpl.java: (ops): Removed. (readyOps): New member variable. (interestOps): New member variable. (readyOps): Implemented. (readyOps): New method to set member variable readyOps. (interestOps): Replaced ops by interestOps. * gnu/java/nio/SelectorImpl.java: (SelectorImpl): Initialize key sets. (select): Call select with -1 instead of Long.MAX_VALUE). (java_do_select): Make it a native method. (getFDsAsArray): New helper method. (select): Remove canceled keys, give only interested file discriptors to java_do_select, set ready ops. (add): No need to initialize keys set here. (add_selected): No need to initialize selected set here. (deregisterCanceledKeys): New helper method. (register): Set interest ops, set attachments, added handling of datagram channels. * gnu/java/nio/ServerSocketChannelImpl: (SocketAccept): Renamed from NioSocketAccept. (implConfigureBlocking): Implemented. (accept): Use SocketAccept instead of NioSocketAccept. * gnu/java/nio/SocketChannelImpl: Reactivate native methods. From-SVN: r59632
Diffstat (limited to 'libjava/gnu/java/nio/ServerSocketChannelImpl.java')
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index e75c68d8166..4a51f2a4b61 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -54,14 +54,8 @@ class ServerSocketChannelImpl extends ServerSocketChannel
boolean connected = false;
// InetSocketAddress sa;
-// private static native int NioSocketAccept (ServerSocketChannelImpl server,
-// SocketChannelImpl s);
-
- private static int NioSocketAccept (ServerSocketChannelImpl server,
- SocketChannelImpl s)
- {
- return 0;
- }
+ private static native int SocketAccept (ServerSocketChannelImpl server,
+ SocketChannelImpl s);
protected ServerSocketChannelImpl (SelectorProvider provider)
{
@@ -101,13 +95,14 @@ class ServerSocketChannelImpl extends ServerSocketChannel
protected void implConfigureBlocking (boolean block)
{
+ blocking = block;
}
public SocketChannel accept ()
{
SocketChannelImpl result = new SocketChannelImpl (provider ());
result.sa = new InetSocketAddress (0);
- int res = NioSocketAccept (this, result);
+ int res = SocketAccept (this,result);
return result;
}