From 51914674f406579519e45f82ce7567910ed48032 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Sat, 11 Oct 2003 18:01:35 +0000 Subject: NIOSocket.java (setChannel): Initialize impl. 2003-10-11 Michael Koch * gnu/java/nio/NIOSocket.java (setChannel): Initialize impl. * gnu/java/nio/ServerSocketChannelImpl.java (serverSocket): Made it a NIOServerSocket. (impl): Removed. (ServerSocketChannelImpl): Initialize only serverSocket. (initServerSocket): Removed. (getNativeFD): Rewritten. (implConfigureBlocking): Set socket timeout and removed comment. (accept): Rewritten. * gnu/java/nio/SocketChannelImpl.java (impl): New variable. (connected): Removed. (SocketChannelImpl): Initialize impl too. (getImpl): New method. (isConnected): Rewritten. (read): Rewritten, set position in buffer correctly. (write): Set position in buffer correctly. * java/net/ServerSocket.java (getImpl): New method. * gnu/java/nio/NIOServerSocket.java, gnu/java/nio/natNIOServerSocket.cc: New files. * gnu/java/nio/natServerSocketChannelImpl.cc: Removed. * Makefile.am (ordinary_java_source_files): Added gnu/java/nio/NIOServerSocket.java. (nat_source_files): Removed gnu/java/nio/natServerSocketChannelImpl.cc and added gnu/java/nio/natNIOServerSocket.cc. * Makefile.in: Regenerated. From-SVN: r72345 --- libjava/java/net/ServerSocket.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libjava/java/net/ServerSocket.java') diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index 6b5544b..f4d1ecc 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -76,7 +76,7 @@ public class ServerSocket private boolean closed = false; /* - * This is only used by java.nio. + * This constructor is only used by java.nio. */ // FIXME: Workaround a bug in gcj. //ServerSocket (PlainSocketImpl impl) throws IOException @@ -85,6 +85,16 @@ public class ServerSocket this.impl = impl; this.impl.create (true); } + + /* + * This method is only used by java.nio. + */ + // FIXME: Workaround a bug in gcj. + //PlainSocketImpl getImpl() + SocketImpl getImpl() + { + return impl; + } /** * Constructor that simply sets the implementation. -- cgit v1.1