Org.Mentalis.Security.Ssl.SecureSocket.Receive C# (CSharp) Method

Receive() public method

Receives data from a connected SecureSocket into a specific location of the receive buffer.
is a null reference (Nothing in Visual Basic). An operating system error occurs while accessing the SecureSocket. The SecureSocket has been closed. An error occurred while decrypting the received data.
public Receive ( byte buffer ) : int
buffer byte The storage location for the received data.
return int
		public override int Receive(byte[] buffer) {
			if (buffer == null)
				throw new ArgumentNullException();
			return this.Receive(buffer, 0, buffer.Length, SocketFlags.None);
		}
		/// <summary>

Same methods

SecureSocket::Receive ( byte buffer, SocketFlags socketFlags ) : int
SecureSocket::Receive ( byte buffer, int size, SocketFlags socketFlags ) : int
SecureSocket::Receive ( byte buffer, int offset, int size, SocketFlags socketFlags ) : int

Usage Example

示例#1
0
 /// <summary>
 /// Reads data from the stream.
 /// </summary>
 /// <param name="buffer">The location in memory to store data read from the stream.</param>
 /// <param name="offset">The location in the buffer to begin storing the data to.</param>
 /// <param name="size">The number of bytes to read from the stream.</param>
 /// <returns>The number of bytes read from the stream.</returns>
 /// <exception cref="ArgumentNullException"><paramref name="buffer"/> is a null reference (<b>Nothing</b> in Visual Basic).</exception>
 /// <exception cref="ArgumentOutOfRangeException">The specified <paramref name="offset"/> or <paramref name="size"/> exceeds the size of <paramref name="buffer"/>.</exception>
 /// <exception cref="IOException">There is a failure while reading from the network.</exception>
 public override int Read(byte[] buffer, int offset, int size)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException();
     }
     if (offset < 0 || offset > buffer.Length || size < 0 || size > buffer.Length - offset)
     {
         throw new ArgumentOutOfRangeException();
     }
     if (Socket == null)
     {
         throw new IOException();
     }
     return(Socket.Receive(buffer, offset, size, SocketFlags.None));
 }
All Usage Examples Of Org.Mentalis.Security.Ssl.SecureSocket::Receive