Skip to content

feat: Added websocket ping functionality - #36

Merged
d0sboots merged 1 commit into
bitburner-official:mainfrom
sourdusk:feat/add-websocket-ping
Aug 28, 2025
Merged

feat: Added websocket ping functionality#36
d0sboots merged 1 commit into
bitburner-official:mainfrom
sourdusk:feat/add-websocket-ping

Conversation

@sourdusk

Copy link
Copy Markdown

Feature has been tested, linted, and formatted. Sends a websocket ping every 10 seconds to keep it alive.

signaller.trigger(EventType.ConnectionMade);
});

const interval = setInterval(function ping() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be inside the .on("connection", it's probably not valid to ping on an unopened connection.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it in the place that the library documentation shows it. https://github.com/websockets/ws?tab=readme-ov-file#how-to-detect-and-close-broken-connections

@d0sboots
d0sboots merged commit 785edac into bitburner-official:main Aug 28, 2025
0 of 2 checks passed
@sourdusk
sourdusk deleted the feat/add-websocket-ping branch August 28, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants