diff rep/SessionManager.java @ 12:aee937370052

*** empty log message ***
author pin
date Fri, 02 Nov 2007 13:37:45 +0900
parents 167694db4796
children 00714676d05b
line wrap: on
line diff
--- a/rep/SessionManager.java	Fri Nov 02 13:21:12 2007 +0900
+++ b/rep/SessionManager.java	Fri Nov 02 13:37:45 2007 +0900
@@ -155,11 +155,7 @@
 			//sessionlist.addSessionManager(channel, repCmd);
 			break;
 		case REP.SMCMD_SM_JOIN:
-			smList.add(channel);								//SessionManagerのリストへ追加
-			repCmd.setCMD(repCmd.cmd + 1);						
-			REPPacketSend repSend4 = new REPPacketSend(channel);
-			sm_join_ack(channel);
-			repSend4.send(repCmd);								//ACK
+			sm_join_ack(channel, repCmd);
 			break;
 		case REP.SMCMD_SM_JOIN_ACK:
 			smList.add(channel);								//SessionManagerのリストへ追加
@@ -184,9 +180,15 @@
 		}
 	}
 
-	private void sm_join_ack(SocketChannel channel) {
+	private void sm_join_ack(SocketChannel channel, REPCommand repCmd) {
 		SocketAddress address = channel.socket().getRemoteSocketAddress();
 		System.out.println(address);
+		smList.add(channel);								//SessionManagerのリストへ追加
+		//repCmd.setCMD(repCmd.cmd + 1);
+		repCmd.setCMD(REP.SMCMD_SM_JOIN_ACK);
+		repCmd.setString(repCmd.string + address.toString());
+		REPPacketSend repSend4 = new REPPacketSend(channel);
+		repSend4.send(repCmd);								//ACK
 	}
 
 	private void join_ack(SocketChannel channel, REPCommand repCmd) {