Hi!

The node documentation of the cluster module says about incoming server 
connections: 

When multiple processes are all accept()ing on the same underlying 
> resource, the operating system load-balances across them very efficiently. 
> There is no routing logic in Node.js, or in your program, and no shared 
> state between the workers.


I want to understand what node does when a new incoming connection is 
established and two or more worker are "listening".

As far as I understand what happens after listen(port) is called on a 
workers server instance is, that the master is queried ("queryServer 
internal message") about the given parameters like port and type, and that 
the server returns an "fd handler" (in cluster.js, 
messageHandler.queryServer). This handle is either retrieved or newly 
created. So what is that handle about? It is created in the 
_createServerHandle method in the net module, which creates a new instance 
of process.binding('tcp_wrap').TCP defined in tcp_wrap.cc in case of a 
TCP-based server. 

But where does that "acception" that is mentioned in the documentation take 
place? Is there any (easy) way to create a custom way of distribution of 
new connections to all listening workers?

Thanks in advance!

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to