Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 7971dca7b6 chore(release): 0.1.0-develop.3 [skip ci]
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-23)

### Features

* add socketSetKeepAlive api method ([ac58773](ac5877385b))
2023-07-23 18:37:58 +00:00
Derrick Hammer 5117f381f6
Merge remote-tracking branch 'origin/develop' into develop 2023-07-23 14:36:32 -04:00
Derrick Hammer ac5877385b
feat: add socketSetKeepAlive api method 2023-07-23 14:36:27 -04:00
4 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-23)
### Features
* add socketSetKeepAlive api method ([ac58773](https://git.lumeweb.com/LumeWeb/kernel-swarm/commit/ac5877385b96b7162a646cadc9b9512759f21bbb))
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-23) # [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-23)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/kernel-swarm", "name": "@lumeweb/kernel-swarm",
"version": "0.1.0-develop.2", "version": "0.1.0-develop.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/kernel-swarm", "name": "@lumeweb/kernel-swarm",
"version": "0.1.0-develop.2", "version": "0.1.0-develop.3",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@lumeweb/hyperswarm-web": "0.0.2-develop.8", "@lumeweb/hyperswarm-web": "0.0.2-develop.8",

View File

@ -38,7 +38,7 @@
"patch-package": "^7.0.0", "patch-package": "^7.0.0",
"presetter": "*" "presetter": "*"
}, },
"version": "0.1.0-develop.2", "version": "0.1.0-develop.3",
"readme": "ERROR: No README data found!", "readme": "ERROR: No README data found!",
"overrides": { "overrides": {
"buffer": "^6.0.3" "buffer": "^6.0.3"

View File

@ -82,6 +82,7 @@ addHandler("socketListenEvent", handleSocketListenEvent, {
addHandler("socketListeners", handleSocketListenersEvent); addHandler("socketListeners", handleSocketListenersEvent);
addHandler("socketWrite", handleWriteSocketEvent); addHandler("socketWrite", handleWriteSocketEvent);
addHandler("socketClose", handleCloseSocketEvent); addHandler("socketClose", handleCloseSocketEvent);
addHandler("socketSetKeepAlive", handleSocketSetKeepAliveEvent);
addHandler("createProtomuxChannel", handleCreateProtomuxChannel, { addHandler("createProtomuxChannel", handleCreateProtomuxChannel, {
receiveUpdates: true, receiveUpdates: true,
}); });
@ -240,6 +241,25 @@ function handleCloseSocketEvent(aq: ActiveQuery) {
aq.respond(); aq.respond();
} }
function handleSocketSetKeepAliveEvent(aq: ActiveQuery) {
const socket = validateConnection(aq);
if (!socket) {
return;
}
const { alive = null } = aq.callerInput;
if (!alive) {
aq.reject("alive required");
return;
}
socket.setKeepAlive(aq.callerInput.alive);
aq.respond();
}
async function handleWriteSocketEvent(aq: ActiveQuery) { async function handleWriteSocketEvent(aq: ActiveQuery) {
const socket = validateConnection(aq); const socket = validateConnection(aq);