Compare commits
3 Commits
v0.0.2-dev
...
v0.0.2-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 1c0d11ccb0 | |
Derrick Hammer | 0747c0b31f | |
Derrick Hammer | 57efedd0af |
|
@ -1,3 +1,10 @@
|
|||
## [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)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-swarm-client",
|
||||
"version": "0.0.2-develop.12",
|
||||
"version": "0.0.2-develop.13",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/kernel-swarm-client",
|
||||
"version": "0.0.2-develop.12",
|
||||
"version": "0.0.2-develop.13",
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.9",
|
||||
"async-mutex": "^0.4.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-swarm-client",
|
||||
"version": "0.0.2-develop.12",
|
||||
"version": "0.0.2-develop.13",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
|
|
13
src/index.ts
13
src/index.ts
|
@ -229,15 +229,24 @@ export class Socket extends Client {
|
|||
}
|
||||
|
||||
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 });
|
||||
}
|
||||
|
||||
end(): void {
|
||||
this.callModule("socketExists", { id: this.id }).then(
|
||||
([exists]: ErrTuple) => {
|
||||
if (exists) {
|
||||
this.callModule("socketClose", { id: this.id });
|
||||
if (!exists) {
|
||||
logErr("tried to close a closed socket");
|
||||
}
|
||||
this.callModule("socketClose", { id: this.id });
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue