diff rep/SessionManager.java @ 192:6fb97c7a0b42

*** empty log message ***
author pin
date Fri, 29 Aug 2008 19:50:15 +0900
parents dbf59f82273e
children ff3fcdcccc85
line wrap: on
line diff
--- a/rep/SessionManager.java	Fri Aug 29 18:52:36 2008 +0900
+++ b/rep/SessionManager.java	Fri Aug 29 19:50:15 2008 +0900
@@ -10,6 +10,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
 
 import rep.channel.REPServerSocketChannel;
 import rep.channel.REPSocketChannel;
@@ -69,9 +70,9 @@
 		REPServerSocketChannel<REPCommand> ssc = REPServerSocketChannel.<REPCommand>open(new REPCommandPacker());
 		ssc.configureBlocking(false);	//reuse address 必須
 		ssc.socket().setReuseAddress(true);
-		ssc.socket().bind(new InetSocketAddress(port));
-		//ssc.register(selector, SelectionKey.OP_ACCEPT);
-		registerChannel(selector, ssc, SelectionKey.OP_ACCEPT);
+		ssc.socket().bind(new InetSocketAddress("localhost", port));
+		ssc.register(selector, SelectionKey.OP_ACCEPT, new REPHandlerImpl(-1, this));
+		//registerChannel(selector, ssc, SelectionKey.OP_ACCEPT);
 
 		
 		//sessionlist = new SessionList();
@@ -81,6 +82,7 @@
 		editorList = new LinkedList<Editor>();
 		packetSetList = new LinkedList<PacketSet>();
 		
+		waitingQueue = new LinkedBlockingQueue<SessionManagerEvent>();
 		// main loop
 		//mainLoop();
 	}