Closed vzaychik closed 10 years ago
UDP might reorder and/or duplicate packets, so I don't think the proposed patch is quite sufficient. For this to work, one approach would be to have the sender assign sequence numbers and have the receiver reassemble packets in sequence-number-order.
An alternative would be to provide a TCP-based channel implementation.
Fair enough. I'd consider it an improvement over the current state but not a complete fix.
The previous behavior was to simply to drop large packets; the proposed behavior allows large packets to be either delivered successfully, dropped (which is always possible with UDP) or mangled (if datagrams get reordered). So I'm not sure if I would call it a clear improvement :)
I'm inclined to think providing TCP-based channels as an alternative might be the best way to go.
I am happy to withdraw the pull request. I agree with you that providing TCP-based channels is the best way to go. Since we are being pedantic, I think whether it can be considered an improvement depends on your point of view. In a statistical case on a not super busy network I think it's an improvement. :)
Okay. Bug #100 is open for supporting TCP-based channels.
I'm on it.
Break apart large datagrams into safe-size chunks and send individually to prevent silent message dropping. Note that eventmachine documentation states that send_datagram method should not be used for arbitrarily-large data packets.