view test/TestSelsctor.java @ 6:bdb91f4cea26

It Can connect SessionManagers each other.
author pin
date Fri, 19 Oct 2007 01:26:47 +0900
parents
children
line wrap: on
line source

package test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;

public class TestSelsctor {
	public static void main(String[] args) throws IOException{
		Selector selector = Selector.open();
		ServerSocketChannel ssc = ServerSocketChannel.open();
		ssc.configureBlocking(false);
		ssc.socket().bind(new InetSocketAddress(8765));
		ssc.register(selector, SelectionKey.OP_ACCEPT);
		
		
	}
}