[AMQ-7444] Fallback to remote location for remote address when socket has not been created yet

(cherry picked from commit 0c1b3e9240)
This commit is contained in:
jbonofre 2021-01-13 11:41:17 +01:00
parent 71be503447
commit c27e27c2c3
1 changed files with 9 additions and 2 deletions

View File

@ -49,13 +49,20 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
super(wireFormat, socket, null, null, null); super(wireFormat, socket, null, null, null);
} }
public StompNIOSSLTransport(WireFormat wireFormat, Socket socket, public StompNIOSSLTransport(WireFormat wireFormat, Socket socket,
SSLEngine engine, InitBuffer initBuffer, ByteBuffer inputBuffer) throws IOException { SSLEngine engine, InitBuffer initBuffer, ByteBuffer inputBuffer) throws IOException {
super(wireFormat, socket, engine, initBuffer, inputBuffer); super(wireFormat, socket, engine, initBuffer, inputBuffer);
} }
@Override
public String getRemoteAddress() {
String remoteAddress = super.getRemoteAddress();
if (remoteAddress == null) {
return remoteLocation.toString();
}
return remoteAddress;
}
@Override @Override
protected void initializeStreams() throws IOException { protected void initializeStreams() throws IOException {
codec = new StompCodec(this); codec = new StompCodec(this);