On Fri, Feb 3, 2012 at 07:36, Jimb Esser <[email protected]> wrote:
> The documentation on socket.write says that it queues all of the data
> in kernel or user memory, but empirically it seems to be keeping a
> reference to my buffer object I pass in so that if I make a change
> after calling socket.write it may end up sending the changed data and
> not what was passed to socket.write.  Is this a bug, or expected
> behavior and simply unclear documentation?

Expected behaviour (and arguably unclear documentation).

Node maintains the reference to prevent the GC from reclaiming your
buffer while the write is in progress. Don't touch the buffer again
until your write callback is called.

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

Reply via email to