# HG changeset patch # User pin # Date 1193977272 -32400 # Node ID 167694db479624be4291269a2b874c3118b67b9e # Parent 09316c8a674a63b1cf9de2ac57e8761242a230de *** empty log message *** diff -r 09316c8a674a -r 167694db4796 rep/EditorChannel.java --- a/rep/EditorChannel.java Fri Nov 02 13:21:12 2007 +0900 +++ b/rep/EditorChannel.java Fri Nov 02 13:21:12 2007 +0900 @@ -5,16 +5,17 @@ public abstract class EditorChannel extends SocketChannel { + private REPPacketSend repsend; + private REPPacketReceive reprec; + protected EditorChannel(SelectorProvider provider) { super(provider); } - - private REPPacketSend repsend; - private REPPacketReceive reprec; public void putPacket(REPCommand comm){ repsend.send(comm); } + public REPCommand getPacket(){ REPCommand command = reprec.unpack(); return command; @@ -24,5 +25,10 @@ repsend = new REPPacketSend(channel); reprec = new REPPacketReceive(channel); } + + public void setIO() { + repsend = new REPPacketSend(this); + reprec = new REPPacketReceive(this); + } } diff -r 09316c8a674a -r 167694db4796 rep/SessionManager.java --- a/rep/SessionManager.java Fri Nov 02 13:21:12 2007 +0900 +++ b/rep/SessionManager.java Fri Nov 02 13:21:12 2007 +0900 @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.SocketAddress; import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; @@ -184,7 +185,7 @@ } private void sm_join_ack(SocketChannel channel) { - InetAddress address = channel.socket().getInetAddress(); + SocketAddress address = channel.socket().getRemoteSocketAddress(); System.out.println(address); }