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

This commit is contained in:
jbonofre 2021-01-13 11:41:17 +01:00
parent 07486de0fd
commit 0c1b3e9240
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);
}
public StompNIOSSLTransport(WireFormat wireFormat, Socket socket,
SSLEngine engine, InitBuffer initBuffer, ByteBuffer inputBuffer) throws IOException {
super(wireFormat, socket, engine, initBuffer, inputBuffer);
}
@Override
public String getRemoteAddress() {
String remoteAddress = super.getRemoteAddress();
if (remoteAddress == null) {
return remoteLocation.toString();
}
return remoteAddress;
}
@Override
protected void initializeStreams() throws IOException {
codec = new StompCodec(this);