added a proper ring buffer implementation
wrote a simple program to measure the throughput

.. in two directions
Added real ring buffer implementation

The current implementation involves redundant array copies, and I suspected if that was causing a problem.

It turns out that this isn't likely the root cause, so I might revert this change later
Introduced a constant to control the maximum packet size.

This makes it easier to change this value.
Making the values bigger.

If we have a gigabit ethernet (with effective transfer rate of 100M bps) and 20ms latency, the pipe will hold  100M bits/sec * 0.02sec / 8 bits/byte = 0.25MB. So 1MB or so is big enough for most network, and hopefully this is an acceptable enough memory consumption in case of clogging.
Reimplemented RingBuffer.

This way of implementing reduces the memory footprint when the reader closely follows the writer.
allow the limit value to be adjusted at runtime
Made the window size configurable at runtime
Renaming the class since this is no longer a ring buffer