We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20169d5 commit bf5cfd1Copy full SHA for bf5cfd1
arduino-ide-extension/src/node/web-socket/web-socket-service-impl.ts
@@ -12,9 +12,11 @@ export default class WebSocketServiceImpl implements WebSocketService {
12
public readonly onMessageReceived = this.onMessage.event;
13
14
constructor() {
15
- this.server = new WebSocket.Server({ port: 0 });
16
- this.server.on('connection', this.addClient.bind(this));
17
this.wsClients = [];
+ this.server = new WebSocket.Server({ port: 0 });
+
18
+ const addClient = this.addClient.bind(this);
19
+ this.server.on('connection', addClient);
20
}
21
22
private addClient(ws: WebSocket): void {
0 commit comments