Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class WebSocketConnection extends Connection implements WebSocketCMClient

private volatile boolean userInitiated = false;

private InetSocketAddress socketEndPoint;

@Override
public void connect(InetSocketAddress endPoint, int timeout) {
logger.debug("Connecting to " + endPoint + "...");
Expand All @@ -26,6 +28,8 @@ public void connect(InetSocketAddress endPoint, int timeout) {
oldClient.close();
}

socketEndPoint = endPoint;

newClient.connect();
}

Expand All @@ -51,7 +55,7 @@ public InetAddress getLocalIP() {

@Override
public InetSocketAddress getCurrentEndPoint() {
return client.get().getRemoteSocketAddress();
return socketEndPoint;
}

@Override
Expand All @@ -66,6 +70,8 @@ private void disconnectCore(boolean userInitiated) {
oldClient.close();
this.userInitiated = userInitiated;
}

socketEndPoint = null;
}

private static URI getUri(InetSocketAddress address) {
Expand Down