From f917ebf14cd0e07719f74ea00d25f5f6e6d645df Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Mon, 18 Nov 2002 11:26:03 +0000 Subject: 2002-11-18 Michael Koch * gnu/java/nio/SelectorImpl.java (select): Throww exception when selector is closed, reinitialize counter before reusing it. (implCloseSelector): Implemented. (register): Added support for ServerSocketChannelImpl. * gnu/java/nio/ServerSocketChannelImpl.java (ServerSocketChannelImpl): Create server socket. * gnu/java/nio/SocketChannelImpl.java: Reformated. * java/net/ServerSocket.java (ServerSocket): Create unbound socket. * java/nio/channels/ClosedChannelException.java: Documentation added. * java/nio/channels/ClosedSelectorException.java: New file. --- gnu/java/nio/ServerSocketChannelImpl.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'gnu/java/nio/ServerSocketChannelImpl.java') diff --git a/gnu/java/nio/ServerSocketChannelImpl.java b/gnu/java/nio/ServerSocketChannelImpl.java index 975a6fc1a..b9ed41ed4 100644 --- a/gnu/java/nio/ServerSocketChannelImpl.java +++ b/gnu/java/nio/ServerSocketChannelImpl.java @@ -37,6 +37,7 @@ exception statement from your version. */ package gnu.java.nio; +import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.SocketAddress; @@ -53,10 +54,8 @@ class ServerSocketChannelImpl extends ServerSocketChannel boolean connected = false; InetSocketAddress sa; -/* - private static native int NioSocketAccept (ServerSocketChannelImpl server, - SocketChannelImpl s); -*/ +// private static native int NioSocketAccept (ServerSocketChannelImpl server, +// SocketChannelImpl s); private static int NioSocketAccept (ServerSocketChannelImpl server, SocketChannelImpl s) @@ -68,6 +67,15 @@ class ServerSocketChannelImpl extends ServerSocketChannel { super (provider); fd = SocketChannelImpl.SocketCreate (); + + try + { + sock_object = new ServerSocket (); + } + catch (IOException e) + { + System.err.println ("ServerSocket could not be created."); + } } public void finalizer() @@ -91,7 +99,7 @@ class ServerSocketChannelImpl extends ServerSocketChannel fd = SocketChannelImpl.SocketCreate (); } - protected void implConfigureBlocking (boolean block) + protected void implConfigureBlocking (boolean block) { } -- cgit v1.2.1