Mercurial > hg > Database > Alice
changeset 535:dd20acf579bd dispose
resolve connection bug
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 15 Jun 2015 18:22:27 +0900 |
parents | 82cc94d40628 |
children | d2f7d02c4976 |
files | src/main/java/alice/daemon/AliceDaemon.java src/main/java/alice/datasegment/RemoteDataSegmentManager.java |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/daemon/AliceDaemon.java Mon Jun 15 17:21:51 2015 +0900 +++ b/src/main/java/alice/daemon/AliceDaemon.java Mon Jun 15 18:22:27 2015 +0900 @@ -47,9 +47,10 @@ ServerSocket ss = ssChannel.socket(); ss.setReuseAddress(true); - //InetSocketAddress a = new InetSocketAddress("::", conf.localPort); - InetSocketAddress a = new InetSocketAddress(InetAddress.getLocalHost(), conf.localPort); - //System.out.println(a); + // listen on any address ipv4/ipv6 + InetSocketAddress a = new InetSocketAddress("::", conf.localPort); + + //System.out.println("AliceDaemon.listen: bind to " + a); ss.bind(a); acceptThread = new AcceptThread(ss, "ACCEPT" + conf.localPort); acceptThread.start();
--- a/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Mon Jun 15 17:21:51 2015 +0900 +++ b/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Mon Jun 15 18:22:27 2015 +0900 @@ -29,12 +29,14 @@ boolean connect = true; do { try { + //System.out.println("RemoteDSM connect hostname:" + hostName + " port:" + port); SocketChannel sc = SocketChannel.open(new InetSocketAddress(hostName, port)); connection.socket = sc.socket(); connection.socket.setTcpNoDelay(true); connect = false; logger.info("Connect to " + connection.getInfoString()); } catch (IOException e) { + //System.err.println("Can not connect" + e); try { Thread.sleep(50); } catch (InterruptedException e1) {