changeset 225:e173411a2499

*** empty log message ***
author kent
date Sun, 31 Aug 2008 13:32:15 +0900
parents 6b0dd92b8e45
children e4ed00c82422
files rep/channel/REPServerSocketChannel.java rep/channel/REPSocketChannel.java
diffstat 2 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/rep/channel/REPServerSocketChannel.java	Sun Aug 31 13:28:34 2008 +0900
+++ b/rep/channel/REPServerSocketChannel.java	Sun Aug 31 13:32:15 2008 +0900
@@ -16,7 +16,7 @@
  */
 public class REPServerSocketChannel<P> extends SelectableChannel {
 
-	public static boolean isSimulation;
+	public static boolean isSimulation=false;
 	private ServerSocketChannel ssc;
 	private REPPack<P> packer;
 
--- a/rep/channel/REPSocketChannel.java	Sun Aug 31 13:28:34 2008 +0900
+++ b/rep/channel/REPSocketChannel.java	Sun Aug 31 13:32:15 2008 +0900
@@ -77,6 +77,19 @@
 	public SelectionKey register(REPSelector<P> sel, int ops, Object att) throws ClosedChannelException {
 		return sc.register(sel.selector, ops, att);
 	}
+	@Override
+	public SelectionKey register(Selector sel, int ops, Object att)
+			throws ClosedChannelException {
+		if (sel instanceof REPSelector){
+			return sc.register(((REPSelector<?>)sel).selector, ops);
+		}else if(sel instanceof Selector){
+			return sc.register(sel, ops);
+		}else 
+			return null;
+		//assert(false);
+		//return null;
+	}
+
 
 	@Override
 	public int validOps() {
@@ -138,17 +151,6 @@
 		return sc.connect(semaIP);
 	}
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public SelectionKey register(Selector sel, int ops, Object att)
-			throws ClosedChannelException {
-		if(sel instanceof REPSelector) {
-			REPSelector<P> s = (REPSelector<P>)sel;
-			return sc.register(s.selector, ops,att);
-		}
-		return sc.register(sel, ops,att);
-	}
 
-	
 
 }
\ No newline at end of file