// global scope
var connection = 0;
// on connection
socket['cool_id'] = connection;
connection++;
Could you just do something as simple as this?
On 5/17/2012 8:33 AM, Veeru wrote:
Ok, one question here, am setting a cool_id to the socket, then later
on how can i retrieve this socket from another socket. i.e i want to
send a message from a socket to this particular socket. how to do that?
On Tuesday, 29 November 2011 03:32:24 UTC+5:30, Jann Horn wrote:
2011/11/28 JoeZ99 <[email protected] <mailto:[email protected]>>:
> stupid question here.
> before node 0.6, one could uniquely identify a socket with the
help of the
> "fd" attribute. (by means of socket.fd).
> NOTE: I'm not saying it's needed for programming with this async
stuff going
> on, I think it can comes handy for debugging.
> that attribute is gone now. Are any of you aware of other way of
uniquely
> identifying a socket.??
socket._my_cool_id || (socket._my_cool_id = uuid())
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en