Re: Can NetworkStream.Write() block?
- From: Jesse Houwing <jesse.houwing@xxxxxxxxxxxxxxxx>
- Date: Sat, 19 Jan 2008 18:17:06 +0000 (UTC)
Hello GAZ,
myNetworkStream.Write(byte[], int offset, int size);
From the MSDN documentation:
"
Remarks:
The Write method starts at the specified offset and sends size bytes
from the contents of buffer to the network. The Write method blocks
until the requested number of bytes is sent or a SocketException is
thrown. If you receive a SocketException, use the
SocketException.ErrorCode property to obtain the specific error code,
and refer to the Windows Sockets version 2 API error code
documentation
in MSDN for a detailed description of the error.
"
It says the call blocks until the bytes are sent but aren't the bytes
just queued to the write buffer until the OS feels like sending them
over the wire? Therefore doesn't the call always return pretty much
immediately anyway?
My guess is that it'll block if the buffer is full.
--
Jesse Houwing
jesse.houwing at sogeti.nl
.
- Follow-Ups:
- Re: Can NetworkStream.Write() block?
- From: Gaz
- Re: Can NetworkStream.Write() block?
- References:
- Can NetworkStream.Write() block?
- From: Gaz
- Can NetworkStream.Write() block?
- Prev by Date: SMS-Texting?
- Next by Date: Re: Can NetworkStream.Write() block?
- Previous by thread: Can NetworkStream.Write() block?
- Next by thread: Re: Can NetworkStream.Write() block?
- Index(es):
Relevant Pages
|
Loading