comparison rep/SessionManager.java @ 341:a9a740e685fa

remove session using QUIT_2_ACK
author kono
date Mon, 13 Oct 2008 03:05:53 +0900
parents 5ba5b7a9761b
children 21ad256c25c2
comparison
equal deleted inserted replaced
340:f55843e829d6 341:a9a740e685fa
623 assert(writeQueue.size()<packetLimit) ; 623 assert(writeQueue.size()<packetLimit) ;
624 } 624 }
625 625
626 626
627 public void remove(Editor editor) { 627 public void remove(Editor editor) {
628 Session s0 = null;
629 editorList.remove(editor);
628 for(Session s:sessionList) { 630 for(Session s:sessionList) {
629 s.deleteForwarder(editor); 631 if (s.deleteForwarder(editor)) {
630 } 632 if (editor.getEID()==0) s0=s;
631 //assert(false); 633 }
634 }
635 if (s0!=null) removeSession(s0);
636 updateGUI();
637 }
638
639 private void removeSession(Session s0) {
640 sessionList.remove(s0);
641 // send UPDATE to all the session manager
632 } 642 }
633 643
634 public void setParentPort(int port) { 644 public void setParentPort(int port) {
635 parent_port = port; 645 parent_port = port;
636 } 646 }