So for those who are interested:

I found out that the most easiest way is to emit remaining chunk at the end of 
the stream before doing `this.push(null)`.

Then we only must create on the emitted chunk a new stream instance and write 
it onto it.

Am 14.02.2014 um 22:22 schrieb [email protected]:

> Hey,
> 
> I have a transform stream (something like the Incoming in 
> https://github.com/isaacs/simple-protocol).
> 
> I now would like to keep the underlaying TCP socket alive for new Incoming 
> streams.
> 
> I think wrapping the tcp socket into a Duplex stream which creates a new 
> Incoming transform instance each time when the previous Incoming is full.
> 
> This sounds easy however I fail finding a solution to know when the transform 
> stream has consumed enough data. Listening on the "end" event is not a 
> reliable option as the last chunk could already contain data for the next 
> Incoming message.
> 
> Anyone am idea?
> 
> Best,
> Bo
> 
> -- 
> -- 
> 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 a topic in the Google 
> Groups "nodejs" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/nodejs/Wgpkk_BGwWo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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