@gibme/tcp-server
    Preparing search index...

    Class TCPServer

    Hierarchy

    • Server
      • TCPServer
    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Constructs a new instance of the server

      Parameters

      • options: ServerOpts = {}
      • OptionalconnectionListener: (socket: Socket) => void

      Returns TCPServer

    Accessors

    • get bindIP(): string

      Returns the interface address that the server is bound to

      Returns string

    • get bindPort(): number

      Returns the interface port that the server is bound to

      Returns number

    • get sockets(): Socket[]

      Returns an iterator of currently connected sockets

      Returns Socket[]

    Methods

    • Starts the TCP server

      Parameters

      • Optionalport: number
      • Optionalhostname: string
      • backlog: number = 511

      Returns Promise<void>

    • Destroys all connected sockets and stops the TCP server

      Returns Promise<void>

    • Creates a new TCP server with the provided options

      Parameters

      • options: ServerOpts = {}
      • OptionalconnectionListener: (socket: Socket) => void

      Returns TCPServer