|Subject:||Reading and writing at the same time.|
|Posted by:||Adem Meral (ademmer…@makrosis.com.tr)|
|Date:||Fri, 27 Jun 2003|
In many sample code i saw people read whatever comes in a loop (onExecute is
a loop) and write from a different thread locking the list. So far so good
but what if broadcasting a message to all connected clients one client
blocks the whole operation e.g. bad modem connection, very slow but not
disconnected, receiving 1 mb file. Is there a buffering mechanisme that can
avoid any delay or error? ( I remember Chad talking about enabling buffered
writes but dont know how to enable it or if it was in this context).
So 2 questions.
a. ) Is it safe to write to a read looping thread ? If not, is it good
practice to do in the OnExecute loop a
read whatever there is;
if CheckSomethingToWrite then WriteThem;
b. ) Is it possible to bufferwrite the outgoing data to avoid network delays
to avoid say modem clients to slowdown lan or cable/dsl clients.
Thanks in advance.