Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/channel/REPServerSocketChannel.java @ 143:785a3e8ea858
*** empty log message ***
author | kent |
---|---|
date | Wed, 27 Aug 2008 22:48:10 +0900 |
parents | 01062be677e9 |
children | 31334767e65d |
line wrap: on
line diff
--- a/rep/channel/REPServerSocketChannel.java Wed Aug 27 21:31:21 2008 +0900 +++ b/rep/channel/REPServerSocketChannel.java Wed Aug 27 22:48:10 2008 +0900 @@ -2,6 +2,9 @@ import java.io.IOException; import java.net.ServerSocket; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.nio.channels.spi.SelectorProvider; @@ -26,11 +29,11 @@ } - public REPServerSocketChannel<P> create() throws IOException { + public static <T> REPServerSocketChannel<T> open() throws IOException{ if(isSimulation){ - return new ServerChannelSimulatorImpl<P>(null).open(); + return new ServerChannelSimulatorImpl<T>(null); }else{ - return new REPServerSocketChannel<P>(open()); + return new REPServerSocketChannel<T>(ServerSocketChannel.open()); } } @@ -58,4 +61,10 @@ // TODO Auto-generated method stub return null; } + + + public SelectionKey register(REPSelector sel, int ops, Object att) throws ClosedChannelException { + REPSelector selector = sel; + return selector.register(this, ops, att); + } }