diff options
| author | Michael Koch <konqueror@gmx.de> | 2003-06-18 09:45:00 +0000 |
|---|---|---|
| committer | Michael Koch <konqueror@gmx.de> | 2003-06-18 09:45:00 +0000 |
| commit | f80652ec3090e09e9cb8796b34f2f4ae9a5998e4 (patch) | |
| tree | b8b1162794842b61e55bb8134f03d24a2a597142 /gnu/java/nio/ServerSocketChannelImpl.java | |
| parent | 6c409b7b81c880372be52766ac4243757f669695 (diff) | |
| download | classpath-f80652ec3090e09e9cb8796b34f2f4ae9a5998e4.tar.gz | |
2003-06-18 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileChannelImpl.java,
gnu/java/nio/SelectorImpl.java,
gnu/java/nio/ServerSocketChannelImpl.java,
gnu/java/nio/SocketChannelImpl.java,
java/nio/DirectByteBufferImpl.java:
New versions from libgcj.
Diffstat (limited to 'gnu/java/nio/ServerSocketChannelImpl.java')
| -rw-r--r-- | gnu/java/nio/ServerSocketChannelImpl.java | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/gnu/java/nio/ServerSocketChannelImpl.java b/gnu/java/nio/ServerSocketChannelImpl.java index 3b5dc88af..05ad0aefc 100644 --- a/gnu/java/nio/ServerSocketChannelImpl.java +++ b/gnu/java/nio/ServerSocketChannelImpl.java @@ -35,11 +35,13 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package gnu.java.nio; import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; +import java.net.Socket; import java.net.SocketAddress; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; @@ -47,33 +49,15 @@ import java.nio.channels.spi.SelectorProvider; class ServerSocketChannelImpl extends ServerSocketChannel { - ServerSocket sock_object; - int fd; - int local_port; + ServerSocket serverSocket; boolean blocking = true; boolean connected = false; - InetSocketAddress sa; - - private static int NioSocketAccept (ServerSocketChannelImpl server, - SocketChannelImpl s) - { - return 0; - } protected ServerSocketChannelImpl (SelectorProvider provider) throws IOException { super (provider); - fd = SocketChannelImpl.SocketCreate (); - - try - { - sock_object = new ServerSocket (); - } - catch (IOException e) - { - System.err.println ("ServerSocket could not be created."); - } + serverSocket = new ServerSocket (); } public void finalizer() @@ -93,25 +77,24 @@ class ServerSocketChannelImpl extends ServerSocketChannel protected void implCloseSelectableChannel () throws IOException { connected = false; - SocketChannelImpl.SocketClose (fd); - fd = SocketChannelImpl.SocketCreate (); + serverSocket.close(); } protected void implConfigureBlocking (boolean blocking) throws IOException { - this.blocking = blocking; + this.blocking = blocking; // FIXME } public SocketChannel accept () throws IOException { SocketChannelImpl result = new SocketChannelImpl (provider ()); - result.sa = new InetSocketAddress (0); - int res = NioSocketAccept (this, result); + Socket socket = serverSocket.accept(); + //socket.setChannel (result); // FIXME return result; } public ServerSocket socket () { - return sock_object; + return serverSocket; } } |
