Class/Object

io.scalajs.npm.socketio

Socket

Related Docs: object Socket | package socketio

Permalink

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()

    Permalink

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 addListener(eventName: String, listener: Function): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def client: Client

    Permalink

    A reference to the underlying Client object.

    A reference to the underlying Client object.

    returns

    the Client object.

  7. def clone(): AnyRef

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

    Permalink

    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

    Permalink

    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

    Permalink

    Disconnects this client.

    Disconnects this client.

    close

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

  11. var domain: String

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. def getMaxListeners(): Int

    Permalink
    Definition Classes
    IEventEmitter
  18. def hasOwnProperty(v: String): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def id: String

    Permalink

    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

    Permalink

    Same as Socket.to()

  22. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  24. def join(name: String, fn: Function = js.native): Socket

    Permalink

    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

    Permalink

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

  26. def listenerCount(eventName: String): Int

    Permalink
    Definition Classes
    IEventEmitter
  27. def listeners(eventName: String): Array[Function]

    Permalink
    Definition Classes
    IEventEmitter
  28. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  31. def on(eventName: String, listener: Function): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  32. def once(eventName: String, listener: Function): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  33. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  34. def removeAllListeners(): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  35. def removeAllListeners(eventName: String): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  36. def removeListener(eventName: String, listener: Function): Socket.this.type

    Permalink
    Definition Classes
    IEventEmitter
  37. def request: Request

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    IEventEmitter
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def to(room: String): Socket

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef → Any
  44. var usingDomains: Boolean

    Permalink
    Definition Classes
    IEventEmitter
  45. def valueOf(): Any

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

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

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

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

Inherited from IEventEmitter

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped