2 Replies Latest reply: Aug 21, 2012 8:09 AM by Flamaniac RSS

    socket packet delay

      I have a serious issue that unfortunately I don't know if there is a solution for. The problems is that after a succesfull socket connection to a server data is written to the socket buffer. After the data is written to the buffer flush() is called but the packet sits in the flush buffer for a period of 200ms(Nagle's Algorithm aka ACK). Until 200ms has passed any other packets written to the socket buffer will also sit in the flush buffer waiting for the 200ms time to expire. Most languages that allow socket connections have a tcp_nodelay or equivalent but there is no such thing in actionscript 2/3 that I can find.

      There are two solutions to this issue that I have found but neither are a solution that I would ever consider using. One is to literally alter the registry using "Regedit" to disable Nagle's Algorithm meaning each and every user must edit their registry or suffer the consequences. The other is to blow up the packet size to be so huge (4000+ in length) to meet the requirements for Nagle's Algorithm for it to bypass the 200ms que timer.

      As I mentioned before neither of those are a real solution so I am curious to know if anyone else has a real working solution or a work around of some sort to get past this issue.