# HG changeset patch # User kent # Date 1220003497 -32400 # Node ID 63701e2a2fe8204669388191f9e5b093ae635ea1 # Parent d03e34861a26529a4858fc62c45fb55df2921300 *** empty log message *** diff -r d03e34861a26 -r 63701e2a2fe8 rep/channel/REPSelector.java --- a/rep/channel/REPSelector.java Fri Aug 29 17:16:51 2008 +0900 +++ b/rep/channel/REPSelector.java Fri Aug 29 18:51:37 2008 +0900 @@ -78,6 +78,9 @@ public SelectionKey register(SelectableChannel ch, int ops, Object att) throws ClosedChannelException{ return ch.register(selector, ops, att); } + public SelectionKey register(SelectableChannel ch, int ops) throws ClosedChannelException{ + return register(ch, ops, null); + } /* public SelectionKey register(REPSocketChannel ch, int ops, Object att) throws ClosedChannelException{ return ch.register(selector, ops, att); diff -r d03e34861a26 -r 63701e2a2fe8 rep/channel/REPServerSocketChannel.java --- a/rep/channel/REPServerSocketChannel.java Fri Aug 29 17:16:51 2008 +0900 +++ b/rep/channel/REPServerSocketChannel.java Fri Aug 29 18:51:37 2008 +0900 @@ -15,16 +15,16 @@ public class REPServerSocketChannel

extends ServerSocketChannel{ public static boolean isSimulation; - //private ServerSocketChannel ss; + private ServerSocketChannel ss; private REPPack

packer; - /*protected REPServerSocketChannel(SelectorProvider provider) { + protected REPServerSocketChannel(SelectorProvider provider) { super(provider); - }*/ + } public REPServerSocketChannel(ServerSocketChannel channel, REPPack

_packer){ super(SelectorProvider.provider()); - //ss = channel; + ss = channel; packer = _packer; } @@ -45,36 +45,34 @@ return new REPSocketChannel

(accept(), packer); } - /* @Override public ServerSocket socket() { - return super.socket(); - }*/ + return ss.socket(); + } - /* @Override protected void implCloseSelectableChannel() throws IOException { ss.close(); - }*/ -/* + } + @Override protected void implConfigureBlocking(boolean block) throws IOException { ss.configureBlocking(block); - }*/ + } public SelectionKey register(REPSelector sel, int ops, Object att) throws ClosedChannelException { assert(!isSimulation); REPSelector selector = sel; if(sel!=null) - return selector.register(ss, ops, att); + return selector.register(this, ops, att); else return null; } @Override public SocketChannel accept() throws IOException { - return (SocketChannel) accept1(); + return null;//(SocketChannel) accept1(); } } diff -r d03e34861a26 -r 63701e2a2fe8 rep/channel/SelectorSimulator.java --- a/rep/channel/SelectorSimulator.java Fri Aug 29 17:16:51 2008 +0900 +++ b/rep/channel/SelectorSimulator.java Fri Aug 29 18:51:37 2008 +0900 @@ -40,12 +40,10 @@ } return selectedKeys.size(); } - /* - public SelectionKeySimulator register(SelectableChannelSimulator cs, int opt){ - SelectionKeySimulator key = new SelectionKeySimulator(cs, opt, this); - keyList.add(key); - return key; - }*/ + + public SelectionKeySimulator register(SelectableChannel cs, int opt){ + return register(cs, opt, null); + } public SelectionKeySimulator register(SelectableChannel cs, int opt, Object handler){ SelectionKeySimulator key = new SelectionKeySimulator(cs, opt, this); key.attach(handler);