Author Topic: GNE is buffering to long  (Read 4493 times)

PjotrvA

  • User
  • *
  • Posts: 5
GNE is buffering to long
« on: March 26, 2007, 08:44:30 AM »
Hi,

How can I disable buffering?
It seems GNE is holding packets which should be sent instantly....

Thnx Pjotr

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: GNE is buffering to long
« Reply #1 on: March 26, 2007, 02:56:51 PM »
If I remember correctly, GNE should send any packet it gets immediately, subject to two limitations:

  • Sending the packet would go over the outgoing bandwidth limitation set in the connection options
  • GNE can tell that the outgoing interface is saturated (i.e. send calls are blocking, and the OS could block)

The OS might use its own buffering, which GNE cannot control (at least as far as I know). TCP is used currently for reliable packets, which can introduce its own latencies.

One technique to limit buffering is to use the PacketFeeder functionality with a reasonable outgoing bandwidth setting to allow GNE to notify you when the buffer is empty, so that a packet can be created with the most recent data, rather than creating a packet with old data and letting it sit in a queue.
Gillius
Gillius's Programming http://www.gillius.org/

PjotrvA

  • User
  • *
  • Posts: 5
Re: GNE is buffering to long
« Reply #2 on: March 27, 2007, 07:33:12 AM »
Found the problem.
OnReceive gets called only once if several packets arrive at the same time...

That was our problem

thnx for the effort

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: GNE is buffering to long
« Reply #3 on: March 28, 2007, 12:09:56 AM »
Yes, that's by the docs. The reason is to remove call overhead by combining multiple instances of the same event into one call. The way to respond to onReceive is to get all of the packets you can and deal with them then. If there were more packets received during the call, you'll get it again. I think as a result of that it's also possible that in onRecieve you'll see NO new packets if you read the packets after the event was triggered by before the event got called.
Gillius
Gillius's Programming http://www.gillius.org/