From c7f0bfa7bc43dd121017b582ae801d6a1f828c1d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 1 Jun 2024 00:25:02 +0530 Subject: [PATCH] chore(browser): comments --- server/src/socket-connection/connection.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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,