Mercurial > hg > RemoteEditor > REPSessionManager
view rep/SMConnector.java @ 4:c0db426126b6
*** empty log message ***
author | pin |
---|---|
date | Tue, 11 Sep 2007 18:05:29 +0900 |
parents | 02fa9a68d9a2 |
children | 0bd4ffc33bdb |
line wrap: on
line source
package rep; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SocketChannel; public class SMConnector { private SocketChannel sessionchannel; public void connectSession(String host) { int port = 8765; //int port = Integer.parseInt(args[2]); InetSocketAddress addr = new InetSocketAddress(host, port); try { sessionchannel = SocketChannel.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(); } } }