Constructor and Description |
---|
WebSocketSecure(WebSocketURI uri,
Endpoint endpoint)
Create a new
WebSocket instance. |
WebSocketSecure(WebSocketURI uri,
Endpoint endpoint,
javax.net.ssl.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 java.lang.IllegalArgumentException, java.security.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 eventsjava.lang.IllegalArgumentException
- if 'endpoint' or 'uri' is nulljava.security.NoSuchAlgorithmException
- if the default SSLContext is not supported.SSLContext.getDefault()
public WebSocketSecure(WebSocketURI uri, Endpoint endpoint, javax.net.ssl.SSLContext context) throws java.lang.IllegalArgumentException, java.security.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.java.lang.IllegalArgumentException
- if 'endpoint' or 'uri' is null, or if 'uri' is not securedjava.security.NoSuchAlgorithmException
- if context is null and does notSSLContext.getDefault()
protected void setupSocket() throws java.io.IOException
WebSocket
setupSocket
in class WebSocket
java.io.IOException
- if an IOException
occurs.WebSocket.setSocket(Socket)