Mercurial > hg > RemoteEditor > REPSessionManager
diff test/channeltest/testSeMa.java @ 174:72252e970a8b
*** empty log message ***
author | kent |
---|---|
date | Thu, 28 Aug 2008 19:49:41 +0900 |
parents | 690182302c05 |
children | 5653cf8e3c8b |
line wrap: on
line diff
--- a/test/channeltest/testSeMa.java Thu Aug 28 18:59:30 2008 +0900 +++ b/test/channeltest/testSeMa.java Thu Aug 28 19:49:41 2008 +0900 @@ -21,7 +21,7 @@ public testSeMa(String name, String host, int port){ super(name); IP = new InetSocketAddress(host,port); - ns = testNetworkSimulator.ns; + ns = REPLogger.singleton(); channels = new LinkedList<REPSocketChannel<String>>(); } public void init(){ @@ -55,20 +55,20 @@ for(SelectionKey key : selector.selectedKeys()){ if(key.isAcceptable()){ - ns.writeLog(this, "gets acceptable channel", 1); + ns.writeLog("gets acceptable channel", 1); REPServerSocketChannel<String> sc = (REPServerSocketChannel<String>) key.channel(); REPSocketChannel<String> channel; channel = sc.accept1(); selector.register(channel, SelectionKey.OP_READ, null); - ns.writeLog(this, "accepts a client.", 1); + ns.writeLog("accepts a client.", 1); }else if(key.isReadable()){ - ns.writeLog(this, "gets readable channel", 1); + ns.writeLog("gets readable channel", 1); //SelectableChannelSimulator<String> channel = key.channel(); REPSocketChannel<String> channel = (REPSocketChannel<String>) key.channel(); String packet; packet = channel.read(); - ns.writeLog(this, "receives String==> `"+packet+"\'", 1); + ns.writeLog("receives String==> `"+packet+"\'", 1); channel.write("from SeMa"+this.getName()+": world"); } }