comparison test/TestSelector.java @ 7:5067a6a93d01

*** empty log message ***
author pin
date Fri, 19 Oct 2007 05:16:38 +0900
parents
children
comparison
equal deleted inserted replaced
6:bdb91f4cea26 7:5067a6a93d01
1 package test;
2
3 import java.io.IOException;
4 import java.net.InetSocketAddress;
5 import java.nio.channels.SelectionKey;
6 import java.nio.channels.Selector;
7 import java.nio.channels.ServerSocketChannel;
8
9 public class TestSelector {
10 public static void main(String[] args) throws IOException{
11 Selector selector = Selector.open();
12 ServerSocketChannel ssc = ServerSocketChannel.open();
13 ssc.configureBlocking(false);
14 ssc.socket().bind(new InetSocketAddress(8765));
15 ssc.register(selector, SelectionKey.OP_ACCEPT);
16
17
18 }
19 }