diff --git a/ws2012/P2P/uebungen/4/src/peer/Node.java b/ws2012/P2P/uebungen/4/src/peer/Node.java index 49080a0b..13fc6f7d 100644 --- a/ws2012/P2P/uebungen/4/src/peer/Node.java +++ b/ws2012/P2P/uebungen/4/src/peer/Node.java @@ -35,7 +35,7 @@ public class Node { channel.socket().bind(null); buf = ByteBuffer.allocate(BUF_SIZE); - this.name = channel.getLocalAddress().toString(); + this.name = channel.socket().getLocalSocketAddress().toString(); udpListen = new UDPListen(); thread = new Thread(udpListen); @@ -75,12 +75,7 @@ public class Node { } public SocketAddress getAddress() { - try { - return channel.getLocalAddress(); - } catch (IOException e) { - LOGGER.severe("Address not set yet."); - } - return null; + return channel.socket().getLocalSocketAddress(); } private void putAddrInBuf(ByteBuffer buf, SocketAddress addr) {