Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/channel/REPSocketChannel.java @ 194:be219ba8b39c
*** empty log message ***
author | kono |
---|---|
date | Fri, 29 Aug 2008 20:25:46 +0900 |
parents | 3c82100cdadd |
children | 302c4a0afab6 |
line wrap: on
line diff
--- a/rep/channel/REPSocketChannel.java Fri Aug 29 20:02:23 2008 +0900 +++ b/rep/channel/REPSocketChannel.java Fri Aug 29 20:25:46 2008 +0900 @@ -13,7 +13,7 @@ public class REPSocketChannel<P> extends SelectableChannel{ - private SocketChannel sc; + public SocketChannel sc; private REPPack<P> pack; public REPSocketChannel(SocketChannel channel, REPPack<P> packer) { @@ -21,6 +21,11 @@ pack = packer; } + public REPSocketChannel(SelectableChannel channel, REPPack<P> packer) { + sc = (SocketChannel)channel; + pack = packer; + } + @Override public Object blockingLock() { return sc.blockingLock(); @@ -51,9 +56,9 @@ return sc.provider(); } - @Override - public SelectionKey register(Selector sel, int ops, Object att) throws ClosedChannelException { - return sc.register(sel, ops, att); + + public SelectionKey register(REPSelector<P> sel, int ops, Object att) throws ClosedChannelException { + return sc.register(sel.selector, ops, att); } @Override @@ -110,10 +115,18 @@ } } + public boolean connect(SocketAddress semaIP) throws IOException { return sc.connect(semaIP); } + @Override + public SelectionKey register(Selector sel, int ops, Object att) + throws ClosedChannelException { + assert(false); + return null; + } + } \ No newline at end of file