SelectorImpl.java (register): Use ServerSocketChannelSelectionKey for server socket channels...
2003-10-09 Michael Koch <konqueror@gmx.de> * gnu/java/nio/SelectorImpl.java (register): Use ServerSocketChannelSelectionKey for server socket channels, removed unneeded comments. * gnu/java/nio/ServerSocketChannelImpl.java (ServerSocketChannelImpl): Made class public final. (impl): New member variable. (ServerSocketChannelImpl): Initialize member variables correctly. (initServerSocket): New method. (getNativeFD): Likewise. * gnu/java/nio/ServerSocketChannelSelectionKey.java, gnu/java/nio/natServerSocketChannelImpl.cc: New files. * Makefile.am (ordinary_java_source_files): Added gnu/java/nio/ServerSocketChannelSelectionKey.java. (nat_source_files): Added gnu/java/nio/natServerSocketChannelImpl.cc. * Makefile.in: Regenrated. From-SVN: r72277
This commit is contained in:
parent
4e3cb200a5
commit
137f5e8417
7 changed files with 132 additions and 11 deletions
|
@ -38,6 +38,7 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.nio;
|
||||
|
||||
import gnu.java.net.PlainSocketImpl;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
|
@ -47,9 +48,10 @@ import java.nio.channels.ServerSocketChannel;
|
|||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.channels.spi.SelectorProvider;
|
||||
|
||||
class ServerSocketChannelImpl extends ServerSocketChannel
|
||||
public final class ServerSocketChannelImpl extends ServerSocketChannel
|
||||
{
|
||||
ServerSocket serverSocket;
|
||||
PlainSocketImpl impl;
|
||||
boolean blocking = true;
|
||||
boolean connected = false;
|
||||
|
||||
|
@ -57,7 +59,20 @@ class ServerSocketChannelImpl extends ServerSocketChannel
|
|||
throws IOException
|
||||
{
|
||||
super (provider);
|
||||
serverSocket = new ServerSocket ();
|
||||
impl = new PlainSocketImpl();
|
||||
initServerSocket();
|
||||
}
|
||||
|
||||
/*
|
||||
* This method is only need to call a package private constructor
|
||||
* of java.net.ServerSocket. It only initializes the member variables
|
||||
* "serverSocket".
|
||||
*/
|
||||
private native void initServerSocket() throws IOException;
|
||||
|
||||
public int getNativeFD()
|
||||
{
|
||||
return impl.getNativeFD();
|
||||
}
|
||||
|
||||
public void finalizer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue