Merge pull request #611 from jbonofre/AMQ-7444

[AMQ-7444] Fallback to remote location for remote address when socket has not been created yet
This commit is contained in:
Jean-Baptiste Onofré 2021-01-14 06:29:34 +01:00 committed by GitHub
commit 92120578d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);