- See:
Notifications that are sent from a server to a client, no client's reply is expected.
Example
let socket = io.connect(url, opts)
// the handler will persist across reconnections.
socket.on('directMessage', message => {
// just the same as any event. no reply is required.
})
Methods
(static) directMessage(message)
Direct message.
Parameters:
Name | Type | Description |
---|---|---|
message |
rpc.datatypes.ProcessedMessage | Message. |
(static) directMessageEcho(toUser, message)
Direct message echo. If an user have several connections from
different sockets, and if one client sends rpc.clientRequests.directMessage
, others will receive a
message echo.
Parameters:
Name | Type | Description |
---|---|---|
toUser |
string | Message receiver. |
message |
rpc.datatypes.ProcessedMessage | Message. |
(static) loginConfirmed(userName, authData)
A client should wait until this event before issuing any
requests. If auth has failed rpc.serverNotifications.loginRejected
notification will be emitted
instead. Only one of these two events will be emitted once per
connection. Also transport plugins may use other means of login
confirmation.
Parameters:
Name | Type | Description |
---|---|---|
userName |
string | User name. |
authData |
rpc.datatypes.AuthData | Additional auth data. |
(static) loginRejected(reason)
An auth error event. Also transport plugins may use other means of login rejection.
Parameters:
Name | Type | Description |
---|---|---|
reason |
rpc.datatypes.ChatServiceError | string | Error. |
(static) roomAccessListAdded(roomName, listName, userNames)
Indicates a room access list add.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
listName |
string | List name. Possible values are: 'blacklist'|'adminlist'|'whitelist' |
userNames |
Array.<string> | User names removed from the list. |
(static) roomAccessListRemoved(roomName, listName, userNames)
Indicates a room access list remove.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
listName |
string | List name. Possible values are: 'blacklist'|'adminlist'|'whitelist' |
userNames |
Array.<string> | User names added to the list. |
(static) roomAccessRemoved(roomName)
Indicates that a user has lost a room access permission.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Room name. |
(static) roomJoinedEcho(roomName, id, njoined)
Echoes room join events from other connections of the same user, or a room join event for this connection triggered by the server.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | User name. |
id |
string | Socket id. |
njoined |
number | Number of sockets that are still joined. |
(static) roomLeftEcho(roomName, id, njoined)
Echoes room leave events from other connections of the same user, or a room leave event for this connection triggered by the server.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | User name. |
id |
string | Socket id. |
njoined |
number | Number of sockets that are still joined. |
(static) roomMessage(roomName, message)
Room message.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
message |
rpc.datatypes.ProcessedMessage | Message. |
(static) roomModeChanged(roomName, mode)
Indicates a room mode change.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
mode |
boolean | Room mode. |
(static) roomUserJoined(roomName, userName)
Indicates that an another user has joined a room.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
userName |
string | User name. |
(static) roomUserLeft(roomName, userName)
Indicates that an another user has left a room.
Parameters:
Name | Type | Description |
---|---|---|
roomName |
string | Rooms name. |
userName |
string | User name. |
(static) socketConnectEcho(id, nconnected)
Indicates a connection of an another socket with the same user.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Socket id. |
nconnected |
number | Total number of users's sockets. |
(static) socketDisconnectEcho(id, nconnected)
Indicates a disconnection of an another socket with the same user.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Socket id. |
nconnected |
number | Total number of users's sockets. |
(static) systemMessage(message)
Custom message from an another socket of the same user.
Parameters:
Name | Type | Description |
---|---|---|
message |
Object | Arbitrary data. |