Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/SessionManager.java @ 274:ad487e63e3c8
*** empty log message ***
author | kono |
---|---|
date | Wed, 24 Sep 2008 15:49:09 +0900 |
parents | 5b7abc22e61a |
children | e58695b5118d |
line wrap: on
line diff
--- a/rep/SessionManager.java Mon Sep 22 18:21:35 2008 +0900 +++ b/rep/SessionManager.java Wed Sep 24 15:49:09 2008 +0900 @@ -113,6 +113,7 @@ return false; } + @SuppressWarnings("unchecked") private void select() throws IOException { SessionManagerEvent e; while((e = waitingQueue.poll())!=null){ @@ -133,10 +134,10 @@ handler.handle(key); } catch (ClosedChannelException x) { key.cancel(); - handler.cancel(); + handler.cancel((REPSocketChannel<REPCommand>)key.channel()); } catch (IOException x) { key.cancel(); - handler.cancel(); + handler.cancel((REPSocketChannel<REPCommand>)key.channel()); } } } @@ -415,10 +416,10 @@ } private void setNormalState(REPSocketChannel<REPCommand> channel, int sid) { - System.out.println("SessionManager.setNormalState() : channel = " + channel); - System.out.println("SessionManager.setNormalState() : selector = " + selector); + //System.out.println("SessionManager.setNormalState() : channel = " + channel); + //System.out.println("SessionManager.setNormalState() : selector = " + selector); SelectionKey key = channel.keyFor(selector); - System.out.println("SessionManager.setNormalState() : key = " + key); + // System.out.println("SessionManager.setNormalState() : key = " + key); key.attach(new REPHandlerImpl(sid, this)); } @@ -604,4 +605,14 @@ updateGUI(); } + public void remove(REPSocketChannel<REPCommand> channel) { + for(Session s:sessionList) { + if (s.deleteEditor(channel)) { + return ; + } + } + assert(false); + // can be other session manager? what should I do? + } + }