node.js - Why it use client.set/get instead of Object property? -


all.

I have a question in socket.io socket. O, it provides socket.Set / method for storing and retrieving the value related to the socket. It seems useful but I have a question about it.

Instead of using the socket.Set (key, value) I think the object properties can be an alternative solution like this socket [key] = value

What is the use of user socket Does any special benefit / substitute property get / get profit?

Like Cluster Detailed Replication etc. Thanx in advance

I have analyzed the socket.io source code.

Uses an internal set / memstor, it stores the value for the property property and if it uses rediscover, the set value is stored in Redis.

So the value to other nodes Js can be shared using Redis, by example.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -