Mercurial > hg > RemoteEditor > REPSessionManager
view rep/SMConnector.java @ 137:1ea856259add
*** empty log message ***
author | pin |
---|---|
date | Wed, 27 Aug 2008 18:43:09 +0900 |
parents | 0bd4ffc33bdb |
children | a776ec9ed848 |
line wrap: on
line source
package rep; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SocketChannel; import rep.channel.REPSocketChannel; public class SMConnector { private REPSocketChannel<REPCommand> sessionchannel; public void connectSession(String host) { int port = 8765; //int port = Integer.parseInt(args[2]); InetSocketAddress addr = new InetSocketAddress(host, port); try { sessionchannel = REPSocketChannel.open(); sessionchannel.configureBlocking(true); sessionchannel.connect(addr); System.out.println("connect"); //sessionchannel.configureBlocking(false); while(!sessionchannel.finishConnect()){ System.out.println("afro"); } //registerChannel(selector, sessionchannel, SelectionKey.OP_READ); }catch (IOException e) { e.printStackTrace(); } } }