|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.WebSocket
public class WebSocket
A JavaScript object for a WebSocket.
| Field Summary | |
|---|---|
static int |
CLOSED
The connection has been closed or could not be opened. |
static int |
CLOSING
The connection is going through the closing handshake. |
static int |
CONNECTING
The connection has not yet been established. |
static int |
OPEN
The WebSocket connection is established and communication is possible. |
| Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
| Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
WebSocket()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
close(Object code,
Object reason)
Closes the WebSocket connection or connection attempt, if any. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnclose()
Returns the event handler that fires on close. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnerror()
Returns the event handler that fires on error. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmessage()
Returns the event handler that fires on message. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnopen()
Returns the event handler that fires on open. |
int |
getReadyState()
Returns The current state of the connection. |
static net.sourceforge.htmlunit.corejs.javascript.Scriptable |
jsConstructor(net.sourceforge.htmlunit.corejs.javascript.Context cx,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function ctorObj,
boolean inNewExpr)
JavaScript constructor. |
void |
send(Object content)
Transmits data to the server over the WebSocket connection. |
void |
setOnclose(net.sourceforge.htmlunit.corejs.javascript.Function closeHandler)
Sets the event handler that fires on close. |
void |
setOnerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
Sets the event handler that fires on error. |
void |
setOnmessage(net.sourceforge.htmlunit.corejs.javascript.Function messageHandler)
Sets the event handler that fires on message. |
void |
setOnopen(net.sourceforge.htmlunit.corejs.javascript.Function openHandler)
Sets the event handler that fires on open. |
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
|---|
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope |
| Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONNECTING
public static final int OPEN
public static final int CLOSING
public static final int CLOSED
| Constructor Detail |
|---|
public WebSocket()
| Method Detail |
|---|
public static net.sourceforge.htmlunit.corejs.javascript.Scriptable jsConstructor(net.sourceforge.htmlunit.corejs.javascript.Context cx,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function ctorObj,
boolean inNewExpr)
cx - the current contextargs - the arguments to the WebSocket constructorctorObj - the function objectinNewExpr - Is new or not
public net.sourceforge.htmlunit.corejs.javascript.Function getOnclose()
public void setOnclose(net.sourceforge.htmlunit.corejs.javascript.Function closeHandler)
closeHandler - the event handler that fires on closepublic net.sourceforge.htmlunit.corejs.javascript.Function getOnerror()
public void setOnerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
errorHandler - the event handler that fires on errorpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmessage()
public void setOnmessage(net.sourceforge.htmlunit.corejs.javascript.Function messageHandler)
messageHandler - the event handler that fires on messagepublic net.sourceforge.htmlunit.corejs.javascript.Function getOnopen()
public void setOnopen(net.sourceforge.htmlunit.corejs.javascript.Function openHandler)
openHandler - the event handler that fires on openpublic int getReadyState()
public void close(Object code,
Object reason)
CLOSED, this method does nothing.
code - A numeric value indicating the status code explaining why the connection is being closedreason - A human-readable string explaining why the connection is closingpublic void send(Object content)
content - the body of the message being sent with the request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||