node.js http server response socket write event? -
is there way control each step of tcp socket write know server side progress of large sized image data transfer?
at worst, how alter main node bin folder add event?
finally, can explain me why max length of node.js http tcp sockets 1460?
from documentation:
socket.write(data, [encoding], [callback])
sends data on socket. second parameter specifies encoding in case of string--it defaults utf8 encoding.
returns true if entire data flushed kernel buffer. returns false if or part of data queued in user memory. 'drain' emitted when buffer again free.
the optional callback parameter executed when data written out - may not immediately.
event: 'drain'
emitted when write buffer becomes empty. can used throttle uploads.
see also: return values of socket.write()
so, can either specify callback called once data flushed, or can register "drain" event handler on socket. doesn't tell progress on other side, properly-implemented server send appropriate notifications when queue full, trigger events on node.js side.
Comments
Post a Comment