changeset 153:4cfed12aa3aa

*** empty log message ***
author kono
date Thu, 28 Aug 2008 15:24:54 +0900
parents 2ce1a378da85
children fafbaaa0abd0
files rep/channel/ChannelSimulator.java rep/channel/REPSocketChannel.java
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rep/channel/ChannelSimulator.java	Thu Aug 28 15:05:25 2008 +0900
+++ b/rep/channel/ChannelSimulator.java	Thu Aug 28 15:24:54 2008 +0900
@@ -1,6 +1,7 @@
 package rep.channel;
 
 import java.io.IOException;
+import java.net.SocketAddress;
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.SelectionKey;
@@ -38,6 +39,11 @@
 	public boolean connect(int ip){
 		return ns.connect(ip, this);
 	}
+
+	public boolean connect(SocketAddress semaIP) throws IOException {
+		int ip = ns.nslookup(semaIP);
+		return ns.connect(ip, this);
+	}
 	
 	public ChannelSimulator<P> accept(){
 		return null;
--- a/rep/channel/REPSocketChannel.java	Thu Aug 28 15:05:25 2008 +0900
+++ b/rep/channel/REPSocketChannel.java	Thu Aug 28 15:24:54 2008 +0900
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.nio.ByteBuffer;
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.SelectableChannel;
@@ -116,6 +117,10 @@
 			return new REPSocketChannel<T>(SocketChannel.open());
 		}
 	}
+
+	public boolean connect(SocketAddress semaIP) throws IOException {
+		return sc.connect(semaIP);
+	}