Mentalis.org Security Library documentation

VirtualSocket.Send Method (Byte[])

Sends data to a connected VirtualSocket, starting at the indicated location in the data.

[Visual Basic]
Overridable Overloads Public Function Send( _
   ByVal buffer As Byte() _
) As Integer
[C#]
public virtual int Send(
   byte[] buffer
);

Parameters

buffer
The data to be sent.

Return Value

The number of bytes sent to the VirtualSocket.

Remarks

Use Send for connection-oriented protocols only. For connectionless protocols, either use SendTo or call Connect first, and then call Send. This overload only requires you to provide a data buffer. The offset defaults to 0, the size defaults to the buffer length, and SocketFlags value defaults to None.

You must set the LocalEndPoint property of the current instance before calling this method.

Exceptions

Exception TypeCondition
ArgumentNullExceptionbuffer is a null reference (Nothing in Visual Basic).
SocketExceptionAn operating system error occurs while accessing the socket.
ObjectDisposedExceptionThe VirtualSocket has been closed.

See Also

VirtualSocket Class | Org.Mentalis.Security.Ssl Namespace | VirtualSocket.Send Overload List