Options
All
  • Public
  • Public/Protected
  • All
Menu

P3 server.

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns any

Properties

_cb

_cb: {}

Type declaration

_timeoutInterval

_timeoutInterval: number

connections

connections: any

Active connections

Methods

bind

  • Binds to a p3 instance.

    Parameters

    Returns void

close

  • close(): void
  • Closes the server.

    Returns void

emit

  • emit(event: string, data: any): void
  • Parameters

    • event: string
    • data: any

    Returns void

on

  • on(event: string, callback: Function): void
  • Parameters

    • event: string
    • callback: Function

    Returns void

open

  • open(): void
  • Opens the server.

    Returns void

peerExists

  • peerExists(id: string): boolean
  • Checks if the specified peer exists.

    Parameters

    • id: string

      The ID of the peer to check for.

    Returns boolean

removeEventListener

  • removeEventListener(event: string, callback: Function): void

send

  • send(...args: any): Promise<void>
  • Send some data.

    Parameters

    • Rest ...args: any

      The data to send.

    Returns Promise<void>

unbind

  • unbind(): void
  • Unbinds the server.

    Returns void

Generated using TypeDoc