Mercurial > hg > RemoteEditor > REPSessionManager
diff test/ServerSample.java @ 194:be219ba8b39c
*** empty log message ***
author | kono |
---|---|
date | Fri, 29 Aug 2008 20:25:46 +0900 |
parents | 4ed6393ec68e |
children | 6e0fa3415668 |
line wrap: on
line diff
--- a/test/ServerSample.java Fri Aug 29 20:02:23 2008 +0900 +++ b/test/ServerSample.java Fri Aug 29 20:25:46 2008 +0900 @@ -5,6 +5,9 @@ import java.net.*; import rep.REPCommand; +import rep.REPCommandPacker; +import rep.channel.REPPack; +import rep.channel.REPSelectionKey; import rep.channel.REPSelector; import rep.channel.REPServerSocketChannel; @@ -14,11 +17,12 @@ throws Exception { // セレクタの用意 - REPSelector selector = REPSelector.create(); + REPSelector<REPCommand> selector = REPSelector.create(); + REPPack<REPCommand> pack = new REPCommandPacker(); // サーバソケットチャンネルを作成。5100番ポートを受付ポートに指定 // (非ブロックモードに設定:重要) - REPServerSocketChannel<REPCommand> serverSocketChannel = REPServerSocketChannel.<REPCommand>open(); + REPServerSocketChannel<REPCommand> serverSocketChannel = REPServerSocketChannel.<REPCommand>open(pack); serverSocketChannel.configureBlocking(false); serverSocketChannel.socket().bind(new InetSocketAddress(5100)); @@ -32,7 +36,7 @@ selector.select(); // 獲得したイベントごとに処理を実行 - for (SelectionKey selectionKey : selector.selectedKeys()) { + for (REPSelectionKey<REPCommand> selectionKey : selector.selectedKeys1()) { // サーバの受付処理: // イベントが受付可能である場合、受け付けるべき対象があれば