getLocalAddress -> getLocalSocketAddress !
This commit is contained in:
parent
fed78ba956
commit
30a6d7bde2
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user