The Peek method reads the specified number of bytes from
the socket and copies them into the buffer, but it does not remove
the data from the internal socket buffer. Note that it is possible
for the returned data to contain embedded null characters.
The data returned by the Peek method is not removed from
the socket buffers. It must be consumed by a subsequent call to the
Read method. The return value indicates the number of bytes
that can be read in a single operation, up to the specified buffer
size. However, it is important to note that it may not indicate the
total amount of data available to be read from the socket at that
time.
If no data is available to be read, the method will return a value
of zero. Using this method in a loop to poll a non-blocking socket
may cause the application to become non-responsive. To determine if
there is data available to be read, use the IsReadable
property.