Mercurial > hg > RemoteEditor > REPSessionManager
diff test/channeltest/testSeMa.java @ 205:dfc2afab1325 simulator-nio-both-worked
*** empty log message ***
author | kono |
---|---|
date | Sat, 30 Aug 2008 11:42:52 +0900 |
parents | 4c0a94836357 |
children | 1eec69035548 |
line wrap: on
line diff
--- a/test/channeltest/testSeMa.java Sat Aug 30 11:25:27 2008 +0900 +++ b/test/channeltest/testSeMa.java Sat Aug 30 11:42:52 2008 +0900 @@ -33,17 +33,16 @@ @SuppressWarnings("unchecked") public void run() { - REPSelector selector=null; + REPSelector<String> selector=null; REPServerSocketChannel<String> scs; - REPPack pack = new StringPacker(); + REPPack<String> pack = new StringPacker(); try { selector = REPSelector.<String>create(); scs = REPServerSocketChannel.<String>open(pack); scs.socket().setReuseAddress(true); scs.socket().bind(IP); scs.configureBlocking(false); - //selector.register(scs, SelectionKey.OP_ACCEPT, null); scs.register(selector, SelectionKey.OP_ACCEPT, null); } catch (IOException e1) { ns.writeLog("cannot create REPServerSocketChannel!, exit."); @@ -63,7 +62,6 @@ for(REPSelectionKey<String> key : set) { if(key.isAcceptable()){ - ns.writeLog("gets acceptable channel", 1); REPSocketChannel<String> channel = key.accept(pack); if(channel==null) continue; channel.configureBlocking(false); @@ -72,7 +70,6 @@ }else if(key.isReadable()){ ns.writeLog("gets readable channel", 1); - //SelectableChannelSimulator<String> channel = key.channel(); REPSocketChannel<String> channel = (REPSocketChannel<String>) key.channel(pack); String packet; packet = channel.read();