vendredi 30 mai 2014

Adding FIN to PseudoTcp


Vote count:

0




For my application, I have a packet-oriented, nonreliable data transfer class. That is, you give it a packet, and it makes a best-effort attempt to deliver it to the other side, but if it's lost or corrupted, meh. In other words, it's very much like UDP.


I needed a reliable stream-oriented interface, so I extracted the PseudoTcp class from the WebRTC code and wrote a bit of glue code to interface it with my packet-oriented class. Everything works great until one side calls Close(). It turns out that PseudoTcp doesn't properly implement any states past "established," jumping straight to "closed" without sending any FIN packets. (Talk about "pseudo.")


Is it possible for me to subclass PseudoTcp and inject FIN handling logic (passing packets up to its process method if there're no FIN flags)? I realize implementing TCP must be done with care, because the state machine is carefully designed, and I'm not an expert in this area.


Alternatively, does anyone know of a different reliability library that can use arbitrary interfaces for packet send/receive? If so, it needs to be lightweight--this requirement is the reason I didn't use all of WebRTC to begin with.



asked 29 secs ago






Aucun commentaire:

Enregistrer un commentaire