# HG changeset patch # User fuchita # Date 1194604487 -32400 # Node ID 1544f5c45dd811305538fd559d76f2fdc3204525 # Parent 2d51078d94ddfb7652c20e40c672027edd375928 edit disconnet key.cancel + accept etc diff -r 2d51078d94dd -r 1544f5c45dd8 rep/SessionManager.java --- a/rep/SessionManager.java Fri Nov 09 19:15:06 2007 +0900 +++ b/rep/SessionManager.java Fri Nov 09 19:34:47 2007 +0900 @@ -68,9 +68,10 @@ selector.select(); for(SelectionKey key : selector.selectedKeys()){ if(key.isAcceptable()){ - + /*** serverChannelはenableになったSelectionKeyのchannel ***/ + ServerSocketChannel serverChannel = (ServerSocketChannel)key.channel(); /*** EditorChannel を用いない記述 ***/ - SocketChannel channel = ssc.accept(); //keyからchannelを取って、accept + SocketChannel channel = serverChannel.accept(); //keyからchannelを取って、accept registerChannel (selector, channel, SelectionKey.OP_READ); channel = null; @@ -92,6 +93,7 @@ /*** EditorChannel を用いない記述 ***/ SocketChannel channel = (SocketChannel)key.channel(); REPPacketReceive repRec = new REPPacketReceive(channel); //getPacket(), putPacket() にする。 + repRec.setkey(key); REPCommand repCom = repRec.unpack(); manager(channel, repCom);