This content has been marked as final. Show 4 replies
1 person found this helpful
SocketChannel's SO_RCVBUF fills up and data is lostNo it isn't.
need to fix thisNo you don't.
If one of those socketchannels receives 5kb of data before it is able to processes it, will the 29 other socketchannels be able to receive dataYes.
or do they all share this buffer?No.
As to the rest of your question, stop now. TCP won't even send data to a peer whose receive buffer is full. TCP buffers it in the sender's send buffer. And if that's full, TCP blocks the sender. You don't have to do anything, as TCP already has a far superior implementation to accomplish the same objective. All this is a complete waste of time, energy, and bandwidth.
Hmm maybe the problem was in the send buffer then? I tried just leaving it alone and I sent out about 5000 packets to try to fill it up but I lost a lot of them in the transfer. Would the data be lost if I try to send when the send buffer is full? Any ideas why I might be loosing data then?
Thank you for your time,
AH I poked about some more and it appears that I am ignoring the return value of write()
That would be why I am loosing data.
Thank you for pointing me in the right direction!
Hmm, never ignore a return value ... You must be in non-blocking more, where TCP takes as much as will fit into the send buffer, possibly zero bytes.