Mercurial > hg > RemoteEditor > REPSessionManager
changeset 28:1544f5c45dd8
edit disconnet key.cancel + accept etc
author | fuchita |
---|---|
date | Fri, 09 Nov 2007 19:34:47 +0900 |
parents | 2d51078d94dd |
children | 804867c340e3 |
files | rep/SessionManager.java |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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);