diff --git a/server/src/socket-connection/connection.ts b/server/src/socket-connection/connection.ts index 672e2b54..f96d24aa 100644 --- a/server/src/socket-connection/connection.ts +++ b/server/src/socket-connection/connection.ts @@ -14,3 +14,15 @@ export const createSocketConnection = ( io.on('connection', onConnection); }; +export const createSocketConnectionForRun = ( + io: Namespace, + callback: (socket: Socket) => void, +) => { + const onConnection = async (socket: Socket) => { + logger.log('info',"Client connected " + socket.id); + socket.on('disconnect', () => logger.log('info', "Client disconnected " + socket.id)); + callback(socket); + } + + io.on('connection', onConnection); +};