Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7806887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:40:33+00:00 2026-06-02T02:40:33+00:00

I have a problem which I can’t understand. To understand it I wrote a

  • 0

I have a problem which I can’t understand.

To understand it I wrote a socket client on AS3 and a server on python/twisted, you can see the code of both applications below.

Let’s launch two clients at the same time, arrange them so that you can see both windows and press connection button in both windows. Then press and hold any button.

What I’m expecting:

Client with pressed button sends a message “some data” to the server, then the server sends this message to all the clients(including the original sender) .

Then each client moves right the button ‘connectButton’ and prints a message to the log with time in the following format: “min:secs:milliseconds”.

What is going wrong:

The motion is smooth in the client that sends the message, but in all other clients the motion is jerky.

This happens because messages to those clients arrive later than to the original sending client. And if we have three clients (let’s name them A,B,C) and we send a message from A, the sending time log of B and C will be the same.

Why other clients recieve this messages later than the original sender?

By the way, on ubuntu 10.04/chrome all the motion is smooth. Two clients are launched in separated chromes.

windows screenshot

linux screenshot

Listing of log, four clients simultaneously:

[16:29:33.280858] 62.140.224.1 >> some data
[16:29:33.280912] 87.249.9.98 << some data
[16:29:33.280970] 87.249.9.98 << some data
[16:29:33.281025] 87.249.9.98 << some data
[16:29:33.281079] 62.140.224.1 << some data
[16:29:33.323267] 62.140.224.1 >> some data
[16:29:33.323326] 87.249.9.98 << some data
[16:29:33.323386] 87.249.9.98 << some data
[16:29:33.323440] 87.249.9.98 << some data
[16:29:33.323493] 62.140.224.1 << some data
[16:29:34.123435] 62.140.224.1 >> some data
[16:29:34.123525] 87.249.9.98 << some data
[16:29:34.123593] 87.249.9.98 << some data
[16:29:34.123648] 87.249.9.98 << some data
[16:29:34.123702] 62.140.224.1 << some data

AS3 client code, I left only relevant part, full code here.

        private var socket           :XMLSocket;

        socket = new XMLSocket();
        socket.addEventListener(DataEvent.DATA, dataHandler);

        private function dataHandler(event:DataEvent):void
        {
            var now:Date = new Date();
            textField.appendText(event.data + "          time = " + now.getMinutes() + ":" + now.getSeconds() + ":" + now.getMilliseconds() + "\n");
            connectButton.x += 2;
        }

        private function keyDownHandler(event:KeyboardEvent):void
        {
            socket.send("some data");
        }

        private function connectMouseDownHandler(event:MouseEvent):void
        {
            var connectAddress:String = "ep1c.org";
            var connectPort:Number = 13250;

            Security.loadPolicyFile("xmlsocket://" + connectAddress + ":" + String(connectPort));
            socket.connect(connectAddress, connectPort);
        }

Python server code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:40:35+00:00Added an answer on June 2, 2026 at 2:40 am

    You may be experiencing some combination of ACK delay and/or Nagle’s algorithm. Both of these can selectively delay the movement of data on a TCP session and their implementations vary greatly by platform.

    Try using setsockopt() with TCP_NODELAY on the socket to disable Nagle.

    AFIK, Windows does not let you disable ACK delay on a per socket basis: you must edit the registry and disable it for all TCP. So try TCP_NODELAY first. If that does not work, then experiment with disabling ACK delay. Even if registry editing is not practical for your application, just knowing whether ACK delay is the problem can point you in the right direction for other work-arounds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tricky problem which I can't completely understand. It's jQuery tabs with cookie
I have a problem which i can't seem to find the solution to. I
I have a strange problem which I can't fix: A field: private boolean[][][] gaps;
I have some problem with my open new window popup which it can read
I'm quite new to hibernate and have stumbled on this problem, which I can't
Once again I have a problem which I can't find the solution to. A
I have a problem at hand which can be reduced to something like this
I have a problem which I'm pretty sure that I can't solve without going
I have a problem which I can't seem to be figuring out: I load
I'm rather new to JAXB and have come across a problem which I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.