Skip to content

Commit 5a53ca5

Browse files
committed
documented that getLocalSocketAddress and getRemoteSocketAddress will return null when connection is closed.
1 parent bfc9fbf commit 5a53ca5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/java_websocket/WebSocket.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.java_websocket;
22

33
import java.net.InetSocketAddress;
4+
import java.net.Socket;
45
import java.nio.ByteBuffer;
56
import java.nio.channels.NotYetConnectedException;
67

@@ -72,8 +73,16 @@ public enum Role {
7273

7374
public abstract void startHandshake( ClientHandshakeBuilder handshakedata ) throws InvalidHandshakeException;
7475

76+
/**
77+
* @returns null when connections is closed
78+
* @see Socket#getRemoteSocketAddress()
79+
*/
7580
public abstract InetSocketAddress getRemoteSocketAddress();
7681

82+
/**
83+
* @returns null when connections is closed
84+
* @see Socket#getLocalSocketAddress()
85+
*/
7786
public abstract InetSocketAddress getLocalSocketAddress();
7887

7988
public abstract boolean isConnecting();

0 commit comments

Comments
 (0)