Packages

class Socket extends Object with IEventEmitter

A Socket is the fundamental class for interacting with browser clients. A Socket belongs to a certain Namespace (by default /) and uses an underlying Client to communicate.

It should be noted the Socket doesn't relate directly to the actual underlying TCP/IP socket and it is only the name of the class.

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

Instance Constructors

  1. new Socket()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addListener(eventName: String, listener: Function): Socket.this.type
    Definition Classes
    IEventEmitter
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def client: Client

    A reference to the underlying Client object.

    A reference to the underlying Client object.

    returns

    the Client object.

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compress(v: Boolean): Socket

    Sets a modifier for a subsequent event emission that the event data will only be compressed if the value is true.

    Sets a modifier for a subsequent event emission that the event data will only be compressed if the value is true. Defaults to true when you don't call the method.

  9. def conn: Socket

    A reference to the underlying Client transport connection (engine.io Socket object).

    A reference to the underlying Client transport connection (engine.io Socket object). This allows access to the IO transport layer, which still (mostly) abstracts the actual TCP/IP socket.

    returns

    the underlying Client transport connection

  10. def disconnect(close: Boolean): Socket.this.type

    Disconnects this client.

    Disconnects this client.

    close

    If value of close is true, closes the underlying connection. Otherwise, it just disconnects the namespace.

  11. val domain: String
    Definition Classes
    IEventEmitter
  12. def emit(name: String, args: Any*): Socket.this.type

    Emits an event identified by the string name to the client.

    Emits an event identified by the string name to the client. Any other parameters can be included. All data structures are supported, including Buffer. JavaScript functions can't be serialized/deserialized.

    name

    the event name

    args

    the event arguments

    Definition Classes
    Socket → IEventEmitter
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  17. def getMaxListeners(): Int
    Definition Classes
    IEventEmitter
  18. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  20. def id: String

    A unique identifier for the session, that comes from the underlying Client.

    A unique identifier for the session, that comes from the underlying Client.

    returns

    the unique identifier

  21. def in(room: String): Socket

    Same as Socket.to()

  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  24. def join(name: String, fn: Function = js.native): Socket

    Adds the client to the room, and fires optionally a callback fn with err signature (if any).

    Adds the client to the room, and fires optionally a callback fn with err signature (if any). The client is automatically a member of a room identified with its session id (see Socket#id). The mechanics of joining rooms are handled by the Adapter that has been configured (see Server#adapter above), defaulting to socket.io-adapter.

  25. def leave(name: String, fn: Function = js.native): Socket

    Removes the client from room, and fires optionally a callback fn with err signature (if any).

  26. def listenerCount(eventName: String): Int
    Definition Classes
    IEventEmitter
  27. def listeners(eventName: String): Array[Function]
    Definition Classes
    IEventEmitter
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  31. def on(eventName: String, listener: Function): Socket.this.type
    Definition Classes
    IEventEmitter
  32. def once(eventName: String, listener: Function): Socket.this.type
    Definition Classes
    IEventEmitter
  33. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  34. def removeAllListeners(): Socket.this.type
    Definition Classes
    IEventEmitter
  35. def removeAllListeners(eventName: String): Socket.this.type
    Definition Classes
    IEventEmitter
  36. def removeListener(eventName: String, listener: Function): Socket.this.type
    Definition Classes
    IEventEmitter
  37. def request: Request

    A getter proxy that returns the reference to the request that originated the underlying engine.io Client.

    A getter proxy that returns the reference to the request that originated the underlying engine.io Client. Useful for accessing request headers such as Cookie or User-Agent.

  38. def rooms: Object

    A hash of strings identifying the rooms this client is in, indexed by room name.

    A hash of strings identifying the rooms this client is in, indexed by room name.

    returns

    A hash of strings

  39. def setMaxListeners(n: Int): Socket.this.type
    Definition Classes
    IEventEmitter
  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. def to(room: String): Socket

    Sets a modifier for a subsequent event emission that the event will only be broadcasted to clients that have joined the given room.

  42. def toLocaleString(): String
    Definition Classes
    Object
  43. def toString(): String
    Definition Classes
    AnyRef → Any
  44. val usingDomains: Boolean
    Definition Classes
    IEventEmitter
  45. def valueOf(): Any
    Definition Classes
    Object
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from IEventEmitter

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped