Are pending asynchronous operations are precious resource that should be used sparingly?
I have a slew of connected TcpClients that I'm not expecting input from, but just in case one is misbehaving, I need to keep the input buffers empty. If I have a BeginRead() for each connected client that just stays open indefinitely, is there any harm? The callback will be called when the client is eventually closed and I can just return out of it if !asyncResult.IsCompleted.
I wouldn't know how many bytes to begin reading, though I believe I could share one buffer. Input up to that buffer limit could just sit in the stream, unread. Is there a better way to efficiently discard, disallow, or WAIT on the availability of data in a stream?
Otherwise I need to poll for data available.
Thanks!