comp.lang.ada
 help / color / mirror / Atom feed
* Roundtrip latency problem using Gnoga, on Linux, when testing at localhost address
@ 2016-03-30 15:35 Olivier Henley
  2016-03-31  4:47 ` rieachus
  0 siblings, 1 reply; 10+ messages in thread
From: Olivier Henley @ 2016-03-30 15:35 UTC (permalink / raw)


Hey,

I am trying a small multiplayer 2d game using Gnoga and Phaser.io and and I
am experiencing some 80 ms for any roundtrip test when trying my game at
127.0.0.1:8080. I profiled javascript and it looks like it take 0.4 ms on
the client side to process round_trip().

Anyone has an idea about what is wrong?

Thx,

Olivier

p.s: Here is my roundtrip code:

---- Ada code ----

App_Data.Roundtrip_Input.On_Change_Handler (Handler => On_Roundtrip'Access);

...

loop
    App_Data.Last_Roundtrip_Start := Clock;
    Gnoga.Server.Connection.Execute_Script (ID => App_Data.Window.Connection_ID,Script => "round_trip();");
    delay 0.5;
end loop;

...

procedure On_Roundtrip (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
    App_Data : App_Data_Access := App_Data_Access (Object.Connection_Data);
    Roundtrip_Duration : Duration;
begin
    App_Data.Roundtrip_Span := Clock - App_Data.Last_Roundtrip_Start;
    Roundtrip_Duration := To_Duration (App_Data.Roundtrip_Span);
    Put_Line ("---- Roundtrip ---- :  " & Duration'Image(Roundtrip_Duration));
 
-- output about 0.080 using Chrome
-- output about 0.120 using Firefox

end On_Roundtrip;


---- Javascript code ----

function round_trip()
{
    var round_trip_date = new Date();
    $('#rt').attr('value', round_trip_date.getTime()).change();
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-01  0:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30 15:35 Roundtrip latency problem using Gnoga, on Linux, when testing at localhost address Olivier Henley
2016-03-31  4:47 ` rieachus
2016-03-31  5:23   ` Jeffrey R. Carter
2016-03-31  7:38     ` Dmitry A. Kazakov
2016-03-31 17:02       ` Olivier Henley
2016-03-31 17:44         ` Dmitry A. Kazakov
2016-03-31 16:39     ` Olivier Henley
2016-03-31 20:46       ` Jeffrey R. Carter
2016-03-31 21:14         ` Dmitry A. Kazakov
2016-04-01  0:32         ` Dennis Lee Bieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox