Class: SocketServer

SocketServer(setup)

Represents a socket server that manages socket connections and subscriptions.

Constructor

new SocketServer(setup)

Creates a new instance of the SocketServer class.

Parameters:
Name Type Description
setup Object

The setup object.

Properties
Name Type Description
hosts Array.<string>

An array of allowed hosts for CORS configuration.

port number

The port on which the socket server will listen. Defaults to the value specified in the configuration.

Source:

Members

connections :Array.<SocketConnection>

An array of active socket connections.

Type:
Source:

io :object

The socket.io server instance.

Type:
  • object
Source:

port :number

The port on which the socket server is running.

Type:
  • number
Source:

subscriptions :Array

An array of active subscriptions.

Type:
  • Array
Source:

Methods

getConnection(connectionID) → {SocketConnection|undefined}

Retrieves a socket connection based on the provided connection ID.

Parameters:
Name Type Description
connectionID string

The unique identifier of the socket connection.

Source:
Returns:
  • The socket connection with the given ID or undefined if not found.
Type
SocketConnection | undefined