public class WebSocketSecure extends WebSocket
WebSocket
.Constructor and Description |
---|
WebSocketSecure(WebSocketURI uri,
Endpoint endpoint)
Create a new
WebSocket instance. |
WebSocketSecure(WebSocketURI uri,
Endpoint endpoint,
SSLContext context)
Create a new
WebSocket instance with SSL support. |
Modifier and Type | Method and Description |
---|---|
protected void |
setupSocket()
Open the socket and sets it.
|
close, close, connect, getCurrentState, getEndpoint, getURI, ping, ping, pong, pong, sendBinary, sendText, setSocket
public WebSocketSecure(WebSocketURI uri, Endpoint endpoint) throws IllegalArgumentException, NoSuchAlgorithmException
WebSocket
instance. It doesn't connect to the remote server; user has to call
WebSocket.connect()
to do so.uri
- URI to connect toendpoint
- the endpoint that will handle eventsIllegalArgumentException
- if 'endpoint' or 'uri' is nullNoSuchAlgorithmException
- if the default SSLContext is not supported.SSLContext.getDefault()
public WebSocketSecure(WebSocketURI uri, Endpoint endpoint, SSLContext context) throws IllegalArgumentException, NoSuchAlgorithmException
WebSocket
instance with SSL support. It doesn't connect to the remote server; user has to
call WebSocket.connect()
to do so.uri
- URI to connect toendpoint
- the endpoint that will handle eventscontext
- the SSL context to use, if null
uses the default SSLContext.IllegalArgumentException
- if 'endpoint' or 'uri' is null, or if 'uri' is not securedNoSuchAlgorithmException
- if context is null and does notSSLContext.getDefault()
protected void setupSocket() throws IOException
WebSocket
setupSocket
in class WebSocket
IOException
- if an IOException
occurs.WebSocket.setSocket(Socket)