Mercurial > hg > RemoteEditor > REPSessionManager
changeset 16:cb482350a1aa
*** empty log message ***
author | pin |
---|---|
date | Fri, 02 Nov 2007 14:57:10 +0900 |
parents | 78c211017d3d |
children | 806e34a6fecd |
files | rep/REPPacketReceive.java rep/SessionManager.java |
diffstat | 2 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/REPPacketReceive.java Fri Nov 02 14:49:42 2007 +0900 +++ b/rep/REPPacketReceive.java Fri Nov 02 14:57:10 2007 +0900 @@ -79,7 +79,7 @@ host = st2.nextToken(); String portstring = st2.nextToken(); port = Integer.parseInt(portstring); - int socketInfoLength = host.length() + portstring.length() + 1; + int socketInfoLength = host.length() + portstring.length() + 2; command.setString(string.substring(0, string.length() - socketInfoLength)); } }
--- a/rep/SessionManager.java Fri Nov 02 14:49:42 2007 +0900 +++ b/rep/SessionManager.java Fri Nov 02 14:57:10 2007 +0900 @@ -183,12 +183,13 @@ } private void sm_join_ack(SocketChannel channel, REPCommand repCmd) { - SocketAddress address = channel.socket().getRemoteSocketAddress(); - System.out.println(address); + //SocketAddress address = channel.socket().getRemoteSocketAddress(); + String socketstring = getSocketString(channel); + System.out.println(socketstring); smList.add(channel); //SessionManagerのリストへ追加 //repCmd.setCMD(repCmd.cmd + 1); repCmd.setCMD(REP.SMCMD_SM_JOIN_ACK); - repCmd.setString(repCmd.string + address.toString()); + repCmd.setString(repCmd.string + ":" + socketstring); REPPacketSend repSend4 = new REPPacketSend(channel); repSend4.send(repCmd); //ACK } @@ -250,7 +251,7 @@ String socketString = null; while(stn.hasMoreTokens()){ socketString = stn.nextToken(); - System.out.println(socketString); + //System.out.println(socketString); } return socketString; }