Mercurial > hg > RemoteEditor > REPSessionManager
diff test/TestSelector.java @ 7:5067a6a93d01
*** empty log message ***
author | pin |
---|---|
date | Fri, 19 Oct 2007 05:16:38 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/TestSelector.java Fri Oct 19 05:16:38 2007 +0900 @@ -0,0 +1,19 @@ +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 TestSelector { + 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); + + + } +}