GarageGames/Torque3D — pull request #658 by jamesu (2014-05-19 00:46:45+00:00)
Title: Add send queue to TCPObject

Implements a fix for issue #655 by adding a simple send queue to TCPObject. This also adds a SimpleDataQueue class to the engine (let me know if I somehow missed an already-existing streaming queued buffer class!).

All connected TCPObject instances are processed in the run loop to ensure all data has been sent. The send queue is iterated until either the queue is empty or the TCP layer stops sending bytes through.

Due to the varying mysterious nature of send buffers in TCP implementations it is advised that this code is tested simulating a pretty bad connection to ensure the buffer is actually made use of. In most cases the code will at least act like the old send() as a call to send the data is issued immediately.