changeset 168:4ed6393ec68e

*** empty log message ***
author kono
date Thu, 28 Aug 2008 18:54:01 +0900
parents 3dc194f5e28f
children 2974db051dd8
files rep/channel/REPSelector.java rep/channel/REPServerSocketChannel.java test/ServerSample.java
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rep/channel/REPSelector.java	Thu Aug 28 18:44:05 2008 +0900
+++ b/rep/channel/REPSelector.java	Thu Aug 28 18:54:01 2008 +0900
@@ -69,9 +69,10 @@
 		return selector.wakeup();
 	}
 
-	public SelectionKey register(SelectableChannel ch, int ops, Object att){
-		return null;
+	public SelectionKey register(SelectableChannel ch, int ops, Object att) throws ClosedChannelException{
+		return ch.register(selector, ops, att);
 	}
+	
 
 
 }
--- a/rep/channel/REPServerSocketChannel.java	Thu Aug 28 18:44:05 2008 +0900
+++ b/rep/channel/REPServerSocketChannel.java	Thu Aug 28 18:54:01 2008 +0900
@@ -67,8 +67,9 @@
 	
 
 	public SelectionKey register(REPSelector sel, int ops, Object att) throws ClosedChannelException {
+		assert(!isSimulation);
 		REPSelector selector = sel;
-		return selector.register(this, ops, att);
+		return selector.register(ss, ops, att);
 	}
 
 }
--- a/test/ServerSample.java	Thu Aug 28 18:44:05 2008 +0900
+++ b/test/ServerSample.java	Thu Aug 28 18:54:01 2008 +0900
@@ -14,11 +14,11 @@
 	throws Exception
 	{
 		// セレクタの用意
-		REPSelector selector = REPSelector.open();
+		REPSelector selector = REPSelector.create();
 
 		// サーバソケットチャンネルを作成。5100番ポートを受付ポートに指定
 		// (非ブロックモードに設定:重要)
-		REPServerSocketChannel<REPCommand> serverSocketChannel = REPServerSocketChannel.open();
+		REPServerSocketChannel<REPCommand> serverSocketChannel = REPServerSocketChannel.<REPCommand>open();
 		serverSocketChannel.configureBlocking(false);
 		serverSocketChannel.socket().bind(new InetSocketAddress(5100));