comparison rep/SessionManager.java @ 366:e391433fa9f1

*** empty log message ***
author kono
date Mon, 20 Oct 2008 17:58:02 +0900
parents c432755c3555
children 1bde894edd83
comparison
equal deleted inserted replaced
365:c432755c3555 366:e391433fa9f1
595 } 595 }
596 596
597 break; 597 break;
598 598
599 case SMCMD_PUT_ACK: 599 case SMCMD_PUT_ACK:
600 if (forwarder.isDirect()) {
601 // send put_ack to the editor now.
602 command.setCMD(REP.SMCMD_PUT_ACK);
603 command.string = command.string;
604 command.setEID(command.eid);
605 command.setSID(command.sid);
606 forwarder.send(command);
607 }
600 case SMCMD_JOIN_ACK: 608 case SMCMD_JOIN_ACK:
601 registEditor(forwarder,command); 609 registEditor(forwarder,command);
602 updateGUI(); 610 updateGUI();
603 break; 611 break;
604 612
605 case SMCMD_PUT: 613 case SMCMD_PUT:
606 { 614 {
607 // first connection or forwarded command 615 // first connection or forwarded command
616 routingTable.add(forwarder,getSMID(command.eid),command.sid);
608 if(isMaster()) { 617 if(isMaster()) {
609 command.setCMD(REP.SMCMD_PUT_ACK); 618 command.setCMD(REP.SMCMD_PUT_ACK);
610 command.string = command.string; 619 command.string = command.string;
611 command.setEID(command.eid); 620 command.setEID(command.eid);
612 command.setSID(command.sid); 621 command.setSID(command.sid);
613 smList.sendToSlaves(command); 622 smList.sendToSlaves(command);
614 registEditor(forwarder,command); 623 registEditor(forwarder,command);
615 } else { 624 } else {
616 routingTable.add(forwarder,getSMID(command.eid),command.sid);
617 smList.sendToMaster(command); 625 smList.sendToMaster(command);
618 // registEditor will be done by SMCMD_PUT_ACK 626 // registEditor will be done by SMCMD_PUT_ACK
619 }
620 if (forwarder.isDirect()) {
621 // send put_ack to the editor now.
622 command.setCMD(REP.SMCMD_PUT_ACK);
623 command.string = command.string;
624 command.setEID(command.eid);
625 command.setSID(command.sid);
626 forwarder.send(command);
627 } 627 }
628 updateGUI(); 628 updateGUI();
629 629
630 } 630 }
631 break; 631 break;