Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Monitoring Heartbeat with uWebSockets.js and socket.io Integration and Updating Device Status#1129

AnsweredbyuNetworkingAB
iakuf asked this question inQ&A
Discussion options

I am using this approach to integrate socket.io with uWebSockets.js. How can I monitor the heartbeat? The header of my connection includes a deviceid, and I want to update the deviceid with a Unix timestamp in Redis every heartbeat. The reason for implementing it this way is to determine whether these devices are currently online or, after killing socket.io, if these machines haven't reconnected, I could deduce they are offline by checking the expiration time along with the Unix timestamp. However, I am not able to catch the heartbeat.

You must be logged in to vote

By default uWS guarantees that open/close callbacks are reliable. So you just trust them. No need to track heartbeats.

Replies: 3 comments

Comment options

By default uWS guarantees that open/close callbacks are reliable. So you just trust them. No need to track heartbeats.

You must be logged in to vote
0 replies
Answer selected byuNetworkingAB
Comment options

I am using socket.io, which encapsulates websocket.js. However, I want to capture the last heartbeat and store it.

You must be logged in to vote
0 replies
Comment options

is it normal that device goes offline on 12:20:58 and ONLINE on 12:21:48. it's contiously going online and offline ...

compression: uWS.SHARED_COMPRESSOR, maxPayloadLength: 16 * 1024, maxLifetime: 0, sendPingsAutomatically: false, idleTimeout:45,

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@iakuf@ramaces@uNetworkingAB

[8]ページ先頭

©2009-2025 Movatter.jp