Jump to content

  • Log In with Google      Sign In   
  • Create Account


cookery

Member Since 18 May 2013
Offline Last Active May 18 2013 09:02 AM

Posts I've Made

In Topic: Receive packets in the thread or in game render.

18 May 2013 - 08:14 AM

Hm.. I had call to Receiver function 10-50 times per frame in Game Render function and there aren't any lags. Thank you very much for help :)


In Topic: Receive packets in the thread or in game render.

18 May 2013 - 07:27 AM

To receive messages on a thread, you probably just want to have the thread receive the message and just add it into some sort of thread safe queue, so that the main thread can consume the messages at an appropriate time.

 

Exactly. I have done some tests. In 10 seconds I can:

 

- receive 390 packets in the game render function

- receive 4000 packets in the thread

 

It's very big difference. 390 packets in 10 seconds its very little and it can make some lags example for 20 players. Server sends to one client 100 packets per second, not per frame, so client can receive only 390 packets in 10 seconds (should receive 1000 packets) which I could process them. My only option is just receive in the thread and make safe queue?


PARTNERS