Merge pull request #10 from amhsirak/develop
feat: pass `socket` to RB input handler
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {Namespace, Socket} from 'socket.io';
|
||||
import { Namespace, Socket } from 'socket.io';
|
||||
import logger from "../logger";
|
||||
import registerInputHandlers from '../browser-management/inputHandlers'
|
||||
|
||||
/**
|
||||
* Opens a websocket canal for duplex data transfer and registers all handlers for this data for the recording session.
|
||||
@@ -11,9 +12,10 @@ import logger from "../logger";
|
||||
export const createSocketConnection = (
|
||||
io: Namespace,
|
||||
callback: (socket: Socket) => void,
|
||||
) => {
|
||||
) => {
|
||||
const onConnection = async (socket: Socket) => {
|
||||
logger.log('info',"Client connected " + socket.id);
|
||||
logger.log('info', "Client connected " + socket.id);
|
||||
registerInputHandlers(socket);
|
||||
socket.on('disconnect', () => logger.log('info', "Client disconnected " + socket.id));
|
||||
callback(socket);
|
||||
}
|
||||
@@ -29,11 +31,11 @@ export const createSocketConnection = (
|
||||
* @category BrowserManagement
|
||||
*/
|
||||
export const createSocketConnectionForRun = (
|
||||
io: Namespace,
|
||||
callback: (socket: Socket) => void,
|
||||
io: Namespace,
|
||||
callback: (socket: Socket) => void,
|
||||
) => {
|
||||
const onConnection = async (socket: Socket) => {
|
||||
logger.log('info',"Client connected " + socket.id);
|
||||
logger.log('info', "Client connected " + socket.id);
|
||||
socket.on('disconnect', () => logger.log('info', "Client disconnected " + socket.id));
|
||||
callback(socket);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user