Compare commits
No commits in common. "v0.0.2-develop.13" and "v0.0.2-develop.12" have entirely different histories.
v0.0.2-dev
...
v0.0.2-dev
|
@ -1,10 +1,3 @@
|
||||||
## [0.0.2-develop.13](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.12...v0.0.2-develop.13) (2023-07-22)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* on write and end, log errors if we are trying to use a closed socket ([57efedd](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/commit/57efedd0affd5e647db185aff0ba1be2a137aef3))
|
|
||||||
|
|
||||||
## [0.0.2-develop.12](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.11...v0.0.2-develop.12) (2023-07-22)
|
## [0.0.2-develop.12](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.11...v0.0.2-develop.12) (2023-07-22)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.13",
|
"version": "0.0.2-develop.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.13",
|
"version": "0.0.2-develop.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libkernel": "^0.1.0-develop.9",
|
"@lumeweb/libkernel": "^0.1.0-develop.9",
|
||||||
"async-mutex": "^0.4.0",
|
"async-mutex": "^0.4.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.13",
|
"version": "0.0.2-develop.12",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
13
src/index.ts
13
src/index.ts
|
@ -229,24 +229,15 @@ export class Socket extends Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
write(message: string | Buffer): void {
|
write(message: string | Buffer): void {
|
||||||
this.callModule("socketExists", { id: this.id }).then(
|
|
||||||
([exists]: ErrTuple) => {
|
|
||||||
if (!exists) {
|
|
||||||
logErr("tried to write to closed socket");
|
|
||||||
}
|
|
||||||
this.callModule("socketWrite", { id: this.id, message });
|
|
||||||
},
|
|
||||||
);
|
|
||||||
this.callModule("socketWrite", { id: this.id, message });
|
this.callModule("socketWrite", { id: this.id, message });
|
||||||
}
|
}
|
||||||
|
|
||||||
end(): void {
|
end(): void {
|
||||||
this.callModule("socketExists", { id: this.id }).then(
|
this.callModule("socketExists", { id: this.id }).then(
|
||||||
([exists]: ErrTuple) => {
|
([exists]: ErrTuple) => {
|
||||||
if (!exists) {
|
if (exists) {
|
||||||
logErr("tried to close a closed socket");
|
|
||||||
}
|
|
||||||
this.callModule("socketClose", { id: this.id });
|
this.callModule("socketClose", { id: this.id });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue