Skip to content

Commit

Permalink
breaking: remove binary sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
b-ma committed May 22, 2024
1 parent 8fddd2a commit a111327
Show file tree
Hide file tree
Showing 10 changed files with 302 additions and 756 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"compression": "^1.7.1",
"express": "^4.19.2",
"fast-deep-equal": "^3.1.3",
"fast-text-encoding": "^1.0.0",
"isomorphic-ws": "^5.0.0",
"keyv": "^4.5.4",
"keyv-file": "^0.3.1",
Expand Down
11 changes: 7 additions & 4 deletions src/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { isBrowser, isPlainObject } from '@ircam/sc-utils';

import ContextManager from './ContextManager.js';
import PluginManager from './PluginManager.js';
import Socket from './Socket.js';
import Socket, {
kSocketTerminate,
} from './Socket.js';
import StateManager from './StateManager.js';

import {
CLIENT_HANDSHAKE_REQUEST,
CLIENT_HANDSHAKE_RESPONSE,
Expand Down Expand Up @@ -232,7 +235,7 @@ class Client {
* await client.start();
*/
async init() {
// init socket communications (string and binary)
// init socket communications
await this.socket.init(this.role, this.config);

// we need the try/catch block to change the promise rejection into proper error
Expand Down Expand Up @@ -277,7 +280,7 @@ dependancies on both your server and clients.
break;
}

this.socket.terminate();
this.socket[kSocketTerminate]();
reject(msg);
});

Expand Down Expand Up @@ -371,7 +374,7 @@ dependancies on both your server and clients.

await this.contextManager.stop();
await this.pluginManager.stop();
await this.socket.terminate();
await this.socket[kSocketTerminate]();

await this._dispatchStatus('stopped');
}
Expand Down
Loading

0 comments on commit a111327

Please sign in to comment.