Skip to content

Commit bb4b9c6

Browse files
committed
Fix several IntelliSense comments in NetworkStream
1 parent d35322d commit bb4b9c6

1 file changed

Lines changed: 25 additions & 115 deletions

File tree

‎nanoFramework.System.Net/Sockets/NetworkStream.cs‎

Lines changed: 25 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,17 @@ public class NetworkStream : Stream
3434
/// </summary>
3535
protected bool _disposed;
3636

37-
// Summary:
38-
// Creates a new instance of the System.Net.Sockets.NetworkStream class for
39-
// the specified System.Net.Sockets.Socket.
40-
//
41-
// Parameters:
42-
// socket:
43-
// The System.Net.Sockets.Socket that the System.Net.Sockets.NetworkStream will
44-
// use to send and receive data.
45-
//
46-
// Exceptions:
47-
// System.ArgumentNullException:
48-
// socket is null.
49-
//
50-
// System.IO.IOException:
51-
// socket is not connected.-or- The System.Net.Sockets.Socket.SocketType property
52-
// of socket is not System.Net.Sockets.SocketType.Stream.-or- socket is in a
53-
// nonblocking state.
54-
5537
/// <summary>
5638
/// Creates a new instance of the <see cref="NetworkStream"/> class for the specified <see cref="Socket"/>.
5739
/// </summary>
5840
/// <param name="socket">The <see cref="Socket"/> that the <see cref="NetworkStream"/> will use to send and receive data.</param>
41+
/// <exception cref="ArgumentNullException"><paramref name="socket"/> is <see langword="null"/>.</exception>
42+
/// <exception cref="IOException"><paramref name="socket"/> is not connected. -or- The <see cref="Socket.SocketType"/> property of <paramref name="socket"/> is not <see cref="SocketType.Stream"/>. -or- <paramref name="socket"/> is in a nonblocking state.</exception>
5943
public NetworkStream(Socket socket)
6044
: this(socket, false)
6145
{
6246
}
6347

64-
//
65-
// Summary:
66-
// Initializes a new instance of the System.Net.Sockets.NetworkStream class
67-
// for the specified System.Net.Sockets.Socket with the specified System.Net.Sockets.Socket
68-
// ownership.
69-
//
70-
// Parameters:
71-
// ownsSocket:
72-
// true to indicate that the System.Net.Sockets.NetworkStream will take ownership
73-
// of the System.Net.Sockets.Socket; otherwise, false.
74-
//
75-
// socket:
76-
// The System.Net.Sockets.Socket that the System.Net.Sockets.NetworkStream will
77-
// use to send and receive data.
78-
//
79-
// Exceptions:
80-
// System.IO.IOException:
81-
// socket is not connected.-or- The value of the System.Net.Sockets.Socket.SocketType
82-
// property of socket is not System.Net.Sockets.SocketType.Stream.-or- socket
83-
// is in a nonblocking state.
84-
//
85-
// System.ArgumentNullException:
86-
// socket is null.
87-
8848
/// <summary>
8949
/// Initializes a new instance of the <see cref="NetworkStream"/> class for the specified
9050
/// <see cref="Socket"/> with the specified <see cref="Socket"/> ownership.
@@ -93,6 +53,8 @@ public NetworkStream(Socket socket)
9353
/// use to send and receive data.</param>
9454
/// <param name="ownsSocket"><see langword="true"/> to indicate that the <see cref="NetworkStream"/> will take ownership of the <see cref="Socket"/>;
9555
/// otherwise, <see langword="false"/>.</param>
56+
/// <exception cref="ArgumentNullException"><paramref name="socket"/> is <see langword="null"/>.</exception>
57+
/// <exception cref="IOException"><paramref name="socket"/> is not connected. -or- The <see cref="Socket.SocketType"/> property of <paramref name="socket"/> is not <see cref="SocketType.Stream"/>. -or- <paramref name="socket"/> is in a nonblocking state.</exception>
9658
public NetworkStream(Socket socket, bool ownsSocket)
9759
{
9860
if (socket == null) throw new ArgumentNullException();
@@ -224,24 +186,11 @@ public virtual bool DataAvailable
224186
}
225187
}
226188

227-
//
228-
// Summary:
229-
// Closes the System.Net.Sockets.NetworkStream after waiting the specified time
230-
// to allow data to be sent.
231-
//
232-
// Parameters:
233-
// timeout:
234-
// A 32-bit signed integer that specifies how long to wait to send any remaining
235-
// data before closing.
236-
//
237-
// Exceptions:
238-
// System.ArgumentOutOfRangeException:
239-
// timeout is less than -1.
240-
241189
/// <summary>
242190
/// Closes the <see cref="NetworkStream"/> after waiting the specified time to allow data to be sent.
243191
/// </summary>
244192
/// <param name="timeout">A 32-bit signed integer that specifies the number of milliseconds to wait to send any remaining data before closing.</param>
193+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="timeout"/> is less than -1.</exception>
245194
/// <remarks>
246195
/// <para>The <see cref="Close"/> method frees both unmanaged and managed resources associated with the <see cref="NetworkStream"/>. If the <see cref="NetworkStream"/> owns the underlying Socket, it is closed as well.</para>
247196
/// </remarks>
@@ -250,7 +199,7 @@ public void Close(int timeout)
250199
if (timeout < -1)
251200
throw new ArgumentOutOfRangeException();
252201

253-
System.Threading.Thread.Sleep(timeout);
202+
Threading.Thread.Sleep(timeout);
254203

255204
Close();
256205
}
@@ -289,34 +238,21 @@ public override void Flush()
289238
{
290239
}
291240

292-
// Exceptions:
293-
// System.IO.IOException:
294-
// The underlying System.Net.Sockets.Socket is closed.
295-
//
296-
// System.ArgumentNullException:
297-
// buffer is null.
298-
//
299-
// System.ObjectDisposedException:
300-
// The System.Net.Sockets.NetworkStream is closed.-or- There is a failure reading
301-
// from the network.
302-
//
303-
// System.ArgumentOutOfRangeException:
304-
// offset is less than 0.-or- offset is greater than the length of buffer.-or-
305-
// size is less than 0.-or- size is greater than the length of buffer minus
306-
// the value of the offset parameter. -or-An error occurred when accessing the
307-
// socket. See the Remarks section for more information.
308-
309241
/// <summary>
310242
/// Reads data from the NetworkStream.
311243
/// </summary>
312-
/// <param name="buffer">An array of type Byte that is the location in memory to store data read from the NetworkStream.</param>
313-
/// <param name="offset">The location in buffer to begin storing the data to.</param>
314-
/// <param name="count">The number of bytes to read from the NetworkStream.</param>
315-
/// <returns>The number of bytes read from the NetworkStream.</returns>
244+
/// <param name="buffer">An array of type <see cref="byte"/> that is the location in memory to store data read from the <see cref="NetworkStream"/>.</param>
245+
/// <param name="offset">The location in <paramref name="buffer"/> to begin storing the data to.</param>
246+
/// <param name="count">The number of bytes to read from the <see cref="NetworkStream"/>.</param>
247+
/// <returns>The total number of bytes read into the buffer between zero (0) and the requested count. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown.</returns>
248+
/// <exception cref="IOException">The underlying <see cref="Socket"/> is closed.</exception>
249+
/// <exception cref="ArgumentNullException"><paramref name="buffer"/> is <see langword="null"/>.</exception>
250+
/// <exception cref="ObjectDisposedException">The <see cref="NetworkStream"/> is closed or there is a failure reading from the network.</exception>"
251+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="offset"/> is less than 0 or greater than the length of <paramref name="buffer"/>. -or- <paramref name="count"/> is less than 0 or greater than the length of <paramref name="buffer"/> minus the value of the <paramref name="offset"/> parameter.</exception>
316252
/// <remarks>
317-
/// <para>This method reads data into the buffer parameter and returns the number of bytes successfully read. If no data is available for reading, the Read method returns 0. The Read operation reads as much data as is available, up to the number of bytes specified by the count parameter. If the remote host shuts down the connection, and all available data has been received, the Read method completes immediately and return zero bytes.</para>
253+
/// <para>This method reads data into the <paramref name="buffer"/> parameter and returns the number of bytes successfully read. The <see cref="Read"/> operation reads as much data as is available, up to the number of bytes specified by the <paramref name="count"/> parameter. If the remote host shuts down the connection, and all available data has been received, the Read method completes immediately and return zero bytes.</para>
318254
/// <note type="important">
319-
/// Check to see if the <see cref="NetworkStream"/> is readable by calling the <see cref="CanRead"/> property. If you attempt to read from a <see cref="NetworkStream"/> that is not readable, you will get an IOException.
255+
/// Check to see if the <see cref="NetworkStream"/> is readable by calling the <see cref="CanRead"/> property. If you attempt to read from a <see cref="NetworkStream"/> that is not readable, you will get an <see cref="IOException"/> .
320256
/// </note>
321257
/// </remarks>
322258
public override int Read(byte[] buffer, int offset, int count)
@@ -372,46 +308,20 @@ public override void SetLength(long value)
372308
throw new NotSupportedException();
373309
}
374310

375-
//
376-
// Summary:
377-
// Writes data to the System.Net.Sockets.NetworkStream.
378-
//
379-
// Parameters:
380-
// offset:
381-
// The location in buffer from which to start writing data.
382-
//
383-
// size:
384-
// The number of bytes to write to the System.Net.Sockets.NetworkStream.
385-
//
386-
// buffer:
387-
// An array of type System.Byte that contains the data to write to the System.Net.Sockets.NetworkStream.
388-
//
389-
// Exceptions:
390-
// System.ArgumentOutOfRangeException:
391-
// offset is less than 0.-or- offset is greater than the length of buffer.-or-
392-
// size is less than 0.-or- size is greater than the length of buffer minus
393-
// the value of the offset parameter.
394-
//
395-
// System.ObjectDisposedException:
396-
// The System.Net.Sockets.NetworkStream is closed.-or- There was a failure reading
397-
// from the network.
398-
//
399-
// System.IO.IOException:
400-
// There was a failure while writing to the network. -or-An error occurred when
401-
// accessing the socket. See the Remarks section for more information.
402-
//
403-
// System.ArgumentNullException:
404-
// buffer is null.
405-
406311
/// <summary>
407312
/// Writes data to the <see cref="NetworkStream"/>.
408313
/// </summary>
409-
/// <param name="buffer">An array of type Byte that contains the data to write to the NetworkStream.</param>
410-
/// <param name="offset">The location in buffer from which to start writing data.</param>
411-
/// <param name="count">The number of bytes to write to the NetworkStream.</param>
314+
/// <param name="buffer">An array of type <see cref="byte"/> that contains the data to write to the <see cref="NetworkStream"/>.</param>
315+
/// <param name="offset">The location in <paramref name="buffer"/> from which to start writing data.</param>
316+
/// <param name="count">The number of bytes to write to the <see cref="NetworkStream"/>.</param>
317+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="offset"/> is less than 0 or greater than the length of <paramref name="buffer"/>. -or- <paramref name="count"/> is less than 0 or greater than the length of <paramref name="buffer"/> minus the value of the <paramref name="offset"/> parameter.</exception>
318+
/// <exception cref="ObjectDisposedException">The <see cref="NetworkStream"/> is closed or there is a failure reading from the network.</exception>
319+
/// <exception cref="IOException">There was a failure while writing to the network. -or-An error occurred when accessing the socket. See the Remarks section for more information.</exception>
320+
/// <exception cref="ArgumentNullException"><paramref name="buffer"/> is <see langword="null"/>.</exception>
321+
/// <exception cref="NotSupportedException">The underlying <see cref="Socket"/> is not of type <see cref="SocketType.Stream"/> or <see cref="SocketType.Dgram"/>.</exception>
412322
/// <remarks>
413323
/// The Write method starts at the specified offset and sends count bytes from the contents of buffer to the network.
414-
/// The Write method blocks until the requested number of bytes is sent or a SocketException is thrown.
324+
/// The Write method blocks until the requested number of bytes is sent or a <see cref="SocketException"/> is thrown.
415325
/// If you receive a <see cref="SocketException"/>, use the <see cref="SocketException.ErrorCode"/> property to obtain
416326
/// 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.
417327
/// </remarks>

0 commit comments

Comments
 (0)