Constructor
(protected) new TransportPlugin(server, options)
- Implements:
Parameters:
| Name | Type | Description | 
|---|---|---|
| server | chat-service.ChatService | Service instance. | 
| options | Object | Transport options. | 
Members
(protected, readonly) closed :boolean
Transport is closed and no any handlers invocations will be made.
Type:
- boolean
(protected, readonly) clusterBus :EventEmitter
Cluster communication via an adapter. Emits messages to all services nodes, including the sender node.
Type:
- EventEmitter
Methods
(protected) close() → {Promise.<undefined>}
Stops accepting clients' connections. Disconnects all currently connected clients.
Returns:
Promise that resolves without any data.
- Type
- Promise.<undefined>
(protected) disconnectSocket(id) → {Promise.<undefined>}
Disconnects a socket.
Parameters:
| Name | Type | Description | 
|---|---|---|
| id | string | Socket id. | 
Returns:
Promise that resolves without any data.
- Type
- Promise.<undefined>
(protected) joinChannel(id, channel) → {Promise.<undefined>}
Adds a socket to a channel.
Parameters:
| Name | Type | Description | 
|---|---|---|
| id | string | Socket id. | 
| channel | string | Transport channel. | 
Returns:
Promise that resolves without any data.
- Type
- Promise.<undefined>
(protected) leaveChannel(id, channel) → {Promise.<undefined>}
Removes a socket form a channel.
Parameters:
| Name | Type | Description | 
|---|---|---|
| id | string | Socket id. | 
| channel | string | Transport channel. | 
Returns:
Promise that resolves without any data.
- Type
- Promise.<undefined>
(protected) setEvents() → {undefined}
Starts accepting clients' connections. On each new connection
ChatService integration methods must be called. See
src/SocketIOTransport.js for details about integration.
Returns:
- Type
- undefined