Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #32 from SaitoTech/develop
Browse files Browse the repository at this point in the history
wasm bug fixing
  • Loading branch information
SankaD authored Aug 2, 2023
2 parents 8505037 + acc0ef8 commit b9e5502
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
19 changes: 15 additions & 4 deletions lib/custom/shared_methods.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ export default class WebSharedMethods extends CustomSharedMethods {
let index = Saito.getInstance().addNewSocket(socket);

socket.onmessage = (event: MessageEvent) => {
// console.log("buffer : ", event.data);
Saito.getLibInstance().process_msg_buffer_from_peer(new Uint8Array(event.data), index);
try {
Saito.getLibInstance().process_msg_buffer_from_peer(new Uint8Array(event.data), index);
} catch (error) {
console.error(error);
}
};

socket.onopen = () => {
Saito.getLibInstance().process_new_peer(index, peerData);
try {
Saito.getLibInstance().process_new_peer(index, peerData);
} catch (error) {
console.error(error);
}
};
socket.onclose = () => {
Saito.getLibInstance().process_peer_disconnection(index);
try {
Saito.getLibInstance().process_peer_disconnection(index);
} catch (error) {
console.error(error);
}
};

console.log("connected to : " + url + " with peer index : " + index);
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "saito-js",
"version": "0.0.29",
"version": "0.0.30",
"description": "js wrappings around saito-core using wasm",
"scripts": {
"test": "env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register 'tests/**/*.ts'",
Expand Down Expand Up @@ -36,7 +36,7 @@
"morgan": "~1.10.0",
"node-fetch": "^2.6.1",
"process": "^0.11.10",
"saito-wasm": "^0.0.17",
"saito-wasm": "^0.0.18",
"url": "^0.11.0",
"util": "^0.12.5",
"ws": "^8.13.0"
Expand Down

0 comments on commit b9e5502

Please sign in to comment.