Yes, it's exactly works as  Isaac said, call cb in net._write synchronously 
will be "asynced" by Writable.write if neccessary.

Well, I want to know is this patch worthy to make a pull request? 
Should I make pull request to node? Or part to libuv and part to node?
Thanks!

On Saturday, February 2, 2013 12:29:32 AM UTC+8, Isaac Schlueter wrote:
>
> On Fri, Feb 1, 2013 at 3:50 AM, Ben Noordhuis 
> <[email protected]<javascript:>> 
> 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.


Reply via email to