Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/SessionManager.java @ 336:d00cb51ba652
*** empty log message ***
author | kono |
---|---|
date | Sun, 12 Oct 2008 18:06:54 +0900 |
parents | 4fae49280699 |
children | 5ba5b7a9761b |
line wrap: on
line diff
--- a/rep/SessionManager.java Sun Oct 12 15:09:46 2008 +0900 +++ b/rep/SessionManager.java Sun Oct 12 18:06:54 2008 +0900 @@ -55,8 +55,8 @@ private BlockingQueue<SessionManagerEvent> waitingEventQueue = new LinkedBlockingQueue<SessionManagerEvent>();; String myHost; private LinkedList<PacketSet> writeQueue = new LinkedList<PacketSet>(); - private static int receive_port; - private static int parent_port; + private int receive_port; + private int parent_port; static final int DEFAULT_PORT = 8766; private static final int packetLimit = 200; @@ -69,15 +69,20 @@ port = Integer.parseInt(args[0]); port_s = Integer.parseInt(args[1]); } - receive_port = port; - parent_port = port_s; SessionManager sm = new SessionManager(); + sm.setReceivePort(port); + sm.setParentPort(port_s); sm.init(port,new SessionManagerGUIimpl(sm)); } + public void setReceivePort(int port) { + receive_port = port; + } + + public void openSelector() throws IOException{ selector = REPSelector.<REPCommand>create(); } @@ -537,9 +542,8 @@ } private String getLocalHostName(REPSocketChannel<?> channel) { - String host = null; - host = channel.socket().getLocalAddress().getHostName(); - return host; + //host = channel.socket().getLocalAddress().getHostName(); + return channel.getLocalHostName(); } public void selectSession(SelectButtonEvent event) throws IOException {