diff --git a/server/src/socket-connection/connection.ts b/server/src/socket-connection/connection.ts index f96d24aa..1390bcbf 100644 --- a/server/src/socket-connection/connection.ts +++ b/server/src/socket-connection/connection.ts @@ -1,6 +1,13 @@ import {Namespace, Socket} from 'socket.io'; import logger from "../logger"; +/** + * Opens a websocket canal for duplex data transfer and registers all handlers for this data for the recording session. + * Uses socket.io dynamic namespaces for multiplexing the traffic from different running remote browser instances. + * @param io dynamic namespace on the socket.io server + * @param callback function called after the connection is created providing the socket resource + * @category BrowserManagement + */ export const createSocketConnection = ( io: Namespace, callback: (socket: Socket) => void, @@ -14,6 +21,13 @@ export const createSocketConnection = ( io.on('connection', onConnection); }; +/** + * Opens a websocket canal for duplex data transfer for the recording run. + * Uses socket.io dynamic namespaces for multiplexing the traffic from different running remote browser instances. + * @param io dynamic namespace on the socket.io server + * @param callback function called after the connection is created providing the socket resource + * @category BrowserManagement + */ export const createSocketConnectionForRun = ( io: Namespace, callback: (socket: Socket) => void,