SocketController
Summary
Defines base controller for all controllers which need to handle socket messages.
A SocketController is associated to a namespace to be able to emit a message to the whole socket namespace.
A SocketController is also associated to an emitter to emit socket's clients' messages to pilots.
// Implement a SocketController : "CustomSocketController"
var util = require('util');
var openVeoApi = require('@openveo/api');
function CustomSocketController(namespace) {
CustomSocketController.super_.call(this, namespace);
}
util.inherits(CustomSocketController, openVeoApi.controllers.SocketController);
Constructor
SocketController
Syntax
SocketController
(
-
namespace
Summary
Parameters:
-
namespace
SocketNamespaceThe socket namespace associated to the controller
Methods
connectAction
Syntax
connectAction
(
-
socket
Summary
Handles a client's socket's connection.
Socket has been established with a client.
Parameters:
-
socket
SocketThe socket
disconnectAction
Syntax
disconnectAction
(
-
socket
Summary
Handles a client's socket's disconnection.
Socket connection with a client has been lost.
Parameters:
-
socket
SocketThe socket
errorAction
Syntax
errorAction
(
-
error
-
socket
Summary
Handles a client's socket's connection errors.
An error occurred on socket's communication.
Parameters:
-
error
ErrorThe error
-
socket
SocketThe socket
Properties
namespace
Syntax
Summary
Socket's namespace associated to the controller.