# HG changeset patch # User pin # Date 1193979569 -32400 # Node ID 00714676d05b453bfe85cc4a4bedfe0aa7305d08 # Parent aee937370052ac66d0b749e8d65cb3fc3ed3a1b2 *** empty log message *** diff -r aee937370052 -r 00714676d05b rep/REPPacketReceive.java --- a/rep/REPPacketReceive.java Fri Nov 02 13:37:45 2007 +0900 +++ b/rep/REPPacketReceive.java Fri Nov 02 13:59:29 2007 +0900 @@ -3,6 +3,8 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; +import java.util.LinkedList; +import java.util.StringTokenizer; public class REPPacketReceive { @@ -61,8 +63,23 @@ } String string = text; //System.out.println(string); + getSocket(string); REPCommand repcommand = new REPCommand(cmd, sid, eid, seqid, lineno, textsiz, string); System.out.println("received command: " + repcommand.toString()); return repcommand; } + + + private void getSocket(String string) { + StringTokenizer token = new StringTokenizer(string, "/:"); + LinkedList tokenlist = new LinkedList(); + while(token.hasMoreTokens()){ + tokenlist.add(token.nextToken()); + } + int port = Integer.parseInt(tokenlist.getLast()); + tokenlist.removeLast(); + String host = tokenlist.getLast(); + tokenlist.removeLast(); + System.out.println(host + ":" + port); + } } diff -r aee937370052 -r 00714676d05b rep/SessionManager.java --- a/rep/SessionManager.java Fri Nov 02 13:37:45 2007 +0900 +++ b/rep/SessionManager.java Fri Nov 02 13:59:29 2007 +0900 @@ -159,6 +159,7 @@ break; case REP.SMCMD_SM_JOIN_ACK: smList.add(channel); //SessionManagerのリストへ追加 + break; case REP.SMCMD_UPDATE: int sessionID2 = sessionlist.addSession(channel, repCmd.string); //Sessionを作成