Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 7971dca7b6 | |
Derrick Hammer | 5117f381f6 | |
Derrick Hammer | ac5877385b |
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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"
|
||||||
|
|
20
src/index.ts
20
src/index.ts
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue