Class/Object

org.scalajs.dom.raw

WebSocket

Related Docs: object WebSocket | package raw

Permalink

class WebSocket extends EventTarget

The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

MDN

Annotations
@RawJSType() @native()
Linear Supertypes
EventTarget, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WebSocket
  2. EventTarget
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebSocket(url: String, protocol: Array[String])

    Permalink
  2. new WebSocket(url: String = js.native, protocol: String = js.native)

    Permalink

    url

    The URL as resolved by the constructor. This is always an absolute URL. Read only.

    protocol

    A string indicating the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit

    Permalink

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

    MDN

    Definition Classes
    EventTarget
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. var binaryType: String

    Permalink

    A string indicating the type of binary data being transmitted by the connection.

    A string indicating the type of binary data being transmitted by the connection. This should be either "blob" if DOM Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used.

    MDN

  7. def bufferedAmount: Int

    Permalink

    The number of bytes of data that have been queued using calls to send() but not yet transmitted to the network.

    The number of bytes of data that have been queued using calls to send() but not yet transmitted to the network. This value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb. Read only.

    MDN

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(code: Int = js.native, reason: String = js.native): Unit

    Permalink

    Closes the WebSocket connection or connection attempt, if any.

    Closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.

    MDN

  10. def dispatchEvent(evt: Event): Boolean

    Permalink

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

    MDN

    Definition Classes
    EventTarget
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def extensions: String

    Permalink

    The extensions selected by the server.

    The extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.

    MDN

  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. var onclose: Function1[CloseEvent, _]

    Permalink

    An event listener to be called when the WebSocket connection's readyState changes to CLOSED.

    An event listener to be called when the WebSocket connection's readyState changes to CLOSED. The listener receives a CloseEvent named "close".

    MDN

  24. var onerror: Function1[ErrorEvent, _]

    Permalink

    An event listener to be called when an error occurs.

    An event listener to be called when an error occurs. This is a simple event named "error".

    MDN

  25. var onmessage: Function1[MessageEvent, _]

    Permalink

    An event listener to be called when a message is received from the server.

    An event listener to be called when a message is received from the server. The listener receives a MessageEvent named "message".

    MDN

  26. var onopen: Function1[Event, _]

    Permalink

    An event listener to be called when the WebSocket connection's readyState changes to OPEN; this indicates that the connection is ready to send and receive data.

    An event listener to be called when the WebSocket connection's readyState changes to OPEN; this indicates that the connection is ready to send and receive data. The event is a simple one with the name "open".

    MDN

  27. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  28. var protocol: String

    Permalink

    A string indicating the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object.

  29. def readyState: Int

    Permalink

    The current state of the connection; this is one of the Ready state constants.

    The current state of the connection; this is one of the Ready state constants. Read only.

    MDN

  30. def removeEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit

    Permalink

    Removes the event listener previously registered with EventTarget.addEventListener.

    Removes the event listener previously registered with EventTarget.addEventListener.

    MDN

    Definition Classes
    EventTarget
  31. def send(data: ArrayBuffer): Unit

    Permalink
  32. def send(data: Blob): Unit

    Permalink
  33. def send(data: String): Unit

    Permalink

    Transmits data to the server over the WebSocket connection.

    Transmits data to the server over the WebSocket connection.

    MDN

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. var url: String

    Permalink

    The URL as resolved by the constructor.

    The URL as resolved by the constructor. This is always an absolute URL. Read only.

  38. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from EventTarget

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped