elad / node-cluster-socket.io

Writeup on how to make node.js cluster and socket.io play nice
421 stars 63 forks source link

Why resume()? #11

Closed gvilarino closed 9 years ago

gvilarino commented 9 years ago

I've been trying sticky-session with a 4-process cluster and it seems to be working.

However, on your example you mention explicitly the need to call resume() for a slave to take over incoming socket data. The thing is, sticky-session doesn't use resume() and it seems to be working nonetheless.

¿Could you please shed some light? I'm really new to this.

elad commented 9 years ago

From the documentation:

If pauseOnConnect is true, then the socket associated with each incoming connection will be paused, and no data will be read from its handle. This allows connections to be passed between processes without any data being read by the original process. To begin reading data from a paused socket, call resume().

gvilarino commented 9 years ago

so sticky-session's author just clarified that workers automatically resume sockets when receiving them. Closing this.