Author Topic: Issue with receiving packets  (Read 1681 times)

doyoueven

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 0
    • View Profile
Issue with receiving packets
« on: January 22, 2015, 06:34:50 PM »
I have a technical question firstly. then the actual problem.
In bool Processbuffer(int bytes),
how does mReceiveBuffer maintain atomicity. Another thread can come and set it to null while it was actually processing the mreceivebuffer in another thread.

I have a custom server setup. I first tested with just simple console to simulate 1000 packets beings sent per second. What ends up happening is packets after a certain while stop sending, and keeping collecting in the mOut queue. Begin Send is never being invoked or callbacked after a point.

So for slow frequencies like 100 packets per second, its fine and works great. But if I increase it the client side(tcp protocol) fails to send packet and the mOut queue is just filling up .

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue with receiving packets
« Reply #1 on: January 23, 2015, 09:59:56 PM »
Each Receive call is done with a single buffer, and there is only one receive operation per TCP Protocol. This buffer isn't shared with any other threads.

What version of TNet are you using? Last version addressed the possibility of a packet being sent only partially.