UNPKG

raas-server

Version:
25 lines 731 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const client_1 = require("../client"); class ClientService { constructor() { this.clients = new Map(); this.connectIdSeq = 0; } connectClient(socket) { const id = String(this.connectIdSeq++); const client = new client_1.Client(socket, id); this.clients.set(id, client); return client; } disconnectClient(client) { this.clients.delete(client.id); } notify(type, data) { this.clients.forEach(client => { client.connection.sendNotification(type, data); }); } } exports.ClientService = ClientService; //# sourceMappingURL=clientService.js.map