You should build your own ACK system if its important to you the receiver has received the message, so you have proper encapsulation rather than wildly mixing the OSI Network Layers, even if possible, that would be dirty, dirty, dirty. You do not need to resend tough, TCP will do all that for you. Every network protocol I know has its own responses on layer 7, if its necessary for the sender to know.
On Fri, Apr 20, 2012 at 1:17 PM, David Fooks <[email protected]> wrote: > TCP has a whole ACK system built in so there must be a way to know that > the receiving machine has my message. But none of the three options for this > seem to change when the ACKs should no longer be received (when I pull the > connections cable out): > > The three things I tried are: > > The return value of the socket.write(...) call which is always true even > when the connection is lost. > The callback of the socket.write(..., cb) call which is always called even > the connection is lost. > The event of the socket.on('drain') call which is always triggered even the > connection is lost. > > How I'm I supposed to know when messages have not been received? The only > way I can see is to implement my own ACK system. But TCP has an ACK system > implementing my own will double the network load! I should be told once my > message has arrived at its recipient. > > Btw, I know about keepalives but they will only tell me that I have lost my > connection but not what messages have been lost. > > Does anybody know how to do this? > > -- > 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 -- 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
