understanding node documentation for sockets

27 views
Skip to first unread message

Chase de Languillette

unread,
Mar 1, 2015, 10:13:11 AM3/1/15
to nod...@googlegroups.com
I've been looking at the node documentation quite a bit lately and I wish it were more straightforward.  I have a question regarding events that a lot of objects have.

for example, the Socket class has these events listed (http://nodejs.org/api/net.html)
Event: 'lookup'
Event: 'connect'
Event: 'data'
etc

based on tutorials i've seen, i know some of these events send along a parameter.  for example, the 'data' event passes a data object to your event hander with info about the data event.  

my question/problem is that the documentation doesn't explain how these events are supposed to be implemented, what parameters your event handler should take, etc.  are there better resources about this? is the pattern in the html documentation being that the bullet-pointed bits on an event are objects in your event handler?

Peter Rust

unread,
Mar 2, 2015, 9:22:50 AM3/2/15
to nod...@googlegroups.com
> bullet-pointed bits on an event are objects in your event handler?

Yes, the bullets are the arguments passed to the event handler.

-- peter
Reply all
Reply to author
Forward
0 new messages