org.cruxframework.crux.core.client.websocket
Class WebSocket

java.lang.Object
  extended by org.cruxframework.crux.core.client.websocket.WebSocket

public class WebSocket
extends Object

Implementation for HTML5 WebSocket API (http://www.w3.org/TR/2011/WD-websockets-20110419/)

Author:
Thiago da Rosa de Bustamante

Field Summary
static short CLOSED
           
static short CLOSING
           
static short CONNECTING
           
static short OPEN
           
 
Constructor Summary
protected WebSocket(org.cruxframework.crux.core.client.websocket.WebSocketJS socketJS)
           
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addCloseHandler(SocketCloseHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addErrorHandler(SocketErrorHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addMessageHandler(SocketMessageHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addOpenHandler(SocketOpenHandler handler)
           
 void close()
           
 void close(short code, String reason)
           
static WebSocket createIfSupported(String url)
           
static WebSocket createIfSupported(String url, com.google.gwt.core.client.JsArrayString protocols)
           
static WebSocket createIfSupported(String url, String protocol)
           
 double getBufferedAmount()
           
 String getExtensions()
           
 String getProtocol()
           
 short getReadyState()
           
 String getUrl()
           
static boolean isSupported()
           
 void reconnect()
           
 void send(com.google.gwt.typedarrays.shared.ArrayBuffer data)
           
 void send(com.google.gwt.typedarrays.shared.ArrayBufferView data)
           
 void send(Blob data)
           
 void send(String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTING

public static final short CONNECTING
See Also:
Constant Field Values

OPEN

public static final short OPEN
See Also:
Constant Field Values

CLOSING

public static final short CLOSING
See Also:
Constant Field Values

CLOSED

public static final short CLOSED
See Also:
Constant Field Values
Constructor Detail

WebSocket

protected WebSocket(org.cruxframework.crux.core.client.websocket.WebSocketJS socketJS)
Method Detail

getReadyState

public short getReadyState()

getBufferedAmount

public double getBufferedAmount()

getUrl

public String getUrl()

getProtocol

public String getProtocol()

getExtensions

public String getExtensions()

send

public void send(String data)

send

public void send(Blob data)

send

public void send(com.google.gwt.typedarrays.shared.ArrayBuffer data)

send

public void send(com.google.gwt.typedarrays.shared.ArrayBufferView data)

close

public void close()

close

public void close(short code,
                  String reason)

addMessageHandler

public com.google.gwt.event.shared.HandlerRegistration addMessageHandler(SocketMessageHandler handler)

addOpenHandler

public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(SocketOpenHandler handler)

addCloseHandler

public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(SocketCloseHandler handler)

addErrorHandler

public com.google.gwt.event.shared.HandlerRegistration addErrorHandler(SocketErrorHandler handler)

reconnect

public void reconnect()

isSupported

public static final boolean isSupported()

createIfSupported

public static final WebSocket createIfSupported(String url)

createIfSupported

public static final WebSocket createIfSupported(String url,
                                                String protocol)

createIfSupported

public static final WebSocket createIfSupported(String url,
                                                com.google.gwt.core.client.JsArrayString protocols)


Copyright © 2014. All rights reserved.