In blocking mode you set TcpClient.NoDelay = true and then you assume that
after each call to NetworkStream.Write the data is actually sent. BTW, use a
large enough buffer because NetworkStream.Write, on the contrary to
Socket.Send, doesn´t return the number of bytes actually sent to perform a
loop if needed until all data is sent. Also, notice that
NetworkStream.Flush() has no effect in the current implementation because
NetworkStream is not buffered.
Other approach if you really want notification is to switch to non-blocking
mode and use asynchronous methods NetworkStream.BeginWrite and
NetworkStream.EndWrite, which encapsulate internally asynchronous methods
Socket.BeginSend, Socket.EndSend.
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com