Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebSocketServer<User, Auth>

Type parameters

Hierarchy

  • Emitter<ServerEvents<User, Auth>>
    • WebSocketServer

Index

Constructors

  • new WebSocketServer<User, Auth>(__namedParameters: ServerOptions<User, Auth>): WebSocketServer<User, Auth>

Properties

id: string
marshaler: Marshaler

Methods

  • addListener<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • emit<E>(event: E, ...args: Arguments<ServerEvents<User, Auth>[E]>): boolean
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • Rest ...args: Arguments<ServerEvents<User, Auth>[E]>

    Returns boolean

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

  • getMaxListeners(): number
  • Returns number

  • handleUpgrade(req: IncomingMessage, ns: Socket, head: Buffer): Promise<void>
  • listenerCount<E>(event: E): number
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E

    Returns number

  • listeners<E>(event: E): Function[]
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E

    Returns Function[]

  • off<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • on<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • once<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • prependListener<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • prependOnceListener<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • rawListeners<E>(event: E): Function[]
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E

    Returns Function[]

  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • Optional event: E

    Returns WebSocketServer<User, Auth>

  • removeListener<E>(event: E, listener: ServerEvents<User, Auth>[E]): WebSocketServer<User, Auth>
  • Type parameters

    • E: keyof ServerEvents<User, Auth>

    Parameters

    • event: E
    • listener: ServerEvents<User, Auth>[E]

    Returns WebSocketServer<User, Auth>

  • Parameters

    • maxListeners: number

    Returns WebSocketServer<User, Auth>

  • start(): Promise<void>
  • stop(): Promise<void>
  • unsubscribeTopic(conn: ConnIdentifier, topic: string): Promise<boolean>

Generated using TypeDoc