Mono Class Library: System.Net.Sockets.NetworkStream Overview | MembersSystem.Net.Sockets.NetworkStream.Read Method |
Reads data from the current instance and stores it in a data buffer. [Edit]
|
A int containing the number of bytes read from the stream. [Edit]
Type Reason ArgumentNullException buffer is null. [Edit] ArgumentOutOfRangeException offset < 0.
-or-
offset > buffer.Length.
-or-
size < 0.
-or-
size > buffer.Length - offset.
[Edit]System.IO.IOException Note: This method catches all exceptions thrown by the Socket.Receive(Byte[], int, SocketFlags) method.[Edit]ObjectDisposedException The current instance has been disposed. [Edit]
When no incoming data is available, this method blocks and waits for data to arrive.
If the remote socket was shut down gracefully (Socket.Shutdown(SocketShutdown) was called on the socket or the SocketOptionName.Linger option was enabled and Socket.Close was called on the socket) and all data was received, this method immediately returns zero.
Note:[Edit]This method overrides System.IO.Stream.Read(Byte[], int, int).
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0