Skip navigation
bashbashbash
Currently Being Moderated

socket packet delay

Nov 20, 2008 11:26 AM

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.
 
Replies
  • Currently Being Moderated
    Sep 5, 2010 7:54 PM   in reply to bashbashbash

    This is an old post, but I'd like to bump it as opposed to just creating a duplicate.

     

    This is a serious problem for people trying to write real-time applications in Flash. I'd really, really love to be able to specify TCP_NODELAY, but that's obviously not exposed anywhere. As a result, my system looks extremely "jumpy" to end-users due to Nagle buffering issues (I can obviously fix this just fine server-side, but if I want to stream real-time data from the user, e.g. mouse position, dragged objects, then everything will look extremely bad).

     

    Does anyone know a way around this?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2012 8:09 AM   in reply to net7runner

    Meybe try use UDP not TCP (DatagramServer in Air) or send bigger pockets.

    http://en.wikipedia.org/wiki/Nagle%27s_algorithm

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)