Merge branch 'master' into websocket-ssl
This commit is contained in:
commit
b3c32651ff
|
@ -143,7 +143,7 @@ public class SPDYClient
|
|||
|
||||
protected SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
|
||||
{
|
||||
String peerHost = channel.socket().getInetAddress().getHostAddress();
|
||||
String peerHost = channel.socket().getInetAddress().getHostName();
|
||||
int peerPort = channel.socket().getPort();
|
||||
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost, peerPort);
|
||||
engine.setUseClientMode(true);
|
||||
|
|
|
@ -104,7 +104,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOG.debug(e);
|
||||
LOG.ignore(e);
|
||||
connectPromise.failed(e);
|
||||
// rethrow
|
||||
throw e;
|
||||
|
@ -120,7 +120,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
|
|||
|
||||
public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
|
||||
{
|
||||
String peerHost = channel.socket().getInetAddress().getHostAddress();
|
||||
String peerHost = channel.socket().getInetAddress().getHostName();
|
||||
int peerPort = channel.socket().getPort();
|
||||
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost,peerPort);
|
||||
engine.setUseClientMode(true);
|
||||
|
|
|
@ -245,11 +245,14 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Inc
|
|||
@Override
|
||||
public RemoteEndpoint getRemote()
|
||||
{
|
||||
if (!isOpen())
|
||||
ConnectionState state = connection.getIOState().getConnectionState();
|
||||
|
||||
if ((state == ConnectionState.OPEN) || (state == ConnectionState.CONNECTED))
|
||||
{
|
||||
throw new WebSocketException("Session has not been opened yet");
|
||||
return remote;
|
||||
}
|
||||
return remote;
|
||||
|
||||
throw new WebSocketException("RemoteEndpoint unavailable, current state [" + state + "], expecting [OPEN or CONNECTED]");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue