create account

WebSockets and managing multiple client connections by mailhustle

View this thread on: hive.blogpeakd.comecency.com
· @mailhustle · (edited)
WebSockets and managing multiple client connections
So you have multiple users.

Certain operations take time on the backend.

Server updates client via `websockets`.

[Example](https://medium.com/@willrigsbee/how-to-keep-track-of-clients-with-websockets-1a018c23bbfc) how to manage multiple clients: 


![Screen Shot 2018-04-25 at 23.42.49.png](https://steemitimages.com/DQmUo61u7zFpQuYr24TGwH9BsoPFdFY8q7kSDfuDWVuCzMP/Screen%20Shot%202018-04-25%20at%2023.42.49.png)

I was always respecting users and ensuring great usability. Sending love, always love...

# Cannot send objects

https://stackoverflow.com/questions/13028604/sending-a-javascript-object-through-websockets-with-faye

I was figuring it out, why is it displayed as `[object Object]` so now we know. Will have to `JSON.stringify` and then `JSON.parse` probably the easiest way...

# Minimalistic implementation

This is a good one: https://hackernoon.com/nodejs-web-socket-example-tutorial-send-message-connect-express-set-up-easy-step-30347a2c5535
👍  
properties (23)
authormailhustle
permlinkwebsockets-and-managing
categorymailhustle
json_metadata{"tags":["mailhustle","javascript","nodejs","websockets","realityhacking"],"image":["https://steemitimages.com/DQmUo61u7zFpQuYr24TGwH9BsoPFdFY8q7kSDfuDWVuCzMP/Screen%20Shot%202018-04-25%20at%2023.42.49.png"],"links":["https://medium.com/@willrigsbee/how-to-keep-track-of-clients-with-websockets-1a018c23bbfc","https://stackoverflow.com/questions/13028604/sending-a-javascript-object-through-websockets-with-faye","https://hackernoon.com/nodejs-web-socket-example-tutorial-send-message-connect-express-set-up-easy-step-30347a2c5535"],"app":"steemit/0.1","format":"markdown"}
created2018-04-25 22:56:09
last_update2018-04-25 23:44:06
depth0
children0
last_payout2018-05-02 22:56:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length961
author_reputation2,137,733,942
root_title"WebSockets and managing multiple client connections"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,146,655
net_rshares92,732,634
author_curate_reward""
vote details (1)