websocket4j.client
Class WebSocket

java.lang.Object
  extended by websocket4j.AbstractWebSocket
      extended by websocket4j.client.WebSocket

public class WebSocket
extends AbstractWebSocket

Socket wrapper that implements client side of the WebSocket protocol. http://www.whatwg.org/specs/web-socket-protocol/


Constructor Summary
WebSocket(java.lang.String host, java.lang.Integer port, java.lang.String requestUri)
          Creates new web socket connected to given host and port, requesting given URI.
WebSocket(java.lang.String host, java.lang.Integer port, java.lang.String requestUri, java.lang.Integer timeout)
          Creates new web socket connected to given host and port, requesting given URI.
 
Method Summary
 
Methods inherited from class websocket4j.AbstractWebSocket
close, getMessage, isClosed, sendMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocket

public WebSocket(java.lang.String host,
                 java.lang.Integer port,
                 java.lang.String requestUri,
                 java.lang.Integer timeout)
          throws java.io.IOException
Creates new web socket connected to given host and port, requesting given URI.

Parameters:
host - server host name
port - server port number
requestUri - URI to request
timeout - number of milliseconds that the opening handshake can take before being cancelled (if 0 then timeout is ignored)
Throws:
java.io.IOException - thrown when there is a problem with connection or protocol error

WebSocket

public WebSocket(java.lang.String host,
                 java.lang.Integer port,
                 java.lang.String requestUri)
          throws java.io.IOException
Creates new web socket connected to given host and port, requesting given URI.

Parameters:
host - server host name
port - server port number
requestUri - URI to request
Throws:
java.io.IOException - thrown when there is a problem with connection or protocol error