On Fri, Feb 1, 2013 at 3:50 AM, Ben Noordhuis <[email protected]> wrote: > Consider this code: > > var conn = net.connect(/* ... */, function() { > function write() { conn.write('PING', write) } > write(); > }); > > If the network connection is fast enough that the write always > succeeds and the callback is synchronous, you'll overflow the call > stack in seconds flat.
In this case, it's fine. Even if it runs synchronously in the binding layer, the stream wrapper will detect this and nextTick the cb. Note that we call the cb synchronously a few lines below if the queue size is 0. -- -- 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 --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
