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(), _
ByVal socketFlags As SocketFlags _
) As Integer
The number of bytes sent to the VirtualSocket.
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 and SocketFlags. The offset defaults to 0, and the size parameter defaults to the buffer length.
You must set the LocalEndPoint property of the current instance before calling this method.
If you specify the DontRoute flag as the socketflags parameter, the data you are sending will not be routed. If you specify the OutOfBand flag as the socketflags parameter, only out-of-band (OOB) data is sent.
If you set the Blocking property to true, and buffer space is not available within the underlying protocol, this method blocks.
If you are using a message-oriented Socket, and the size of the buffer is greater than the maximum message size of the underlying protocol, no data is sent and Socket will throw a SocketException.
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is a null reference (Nothing in Visual Basic). |
SocketException | An operating system error occurs while accessing the socket. |
ObjectDisposedException | The VirtualSocket has been closed. |
VirtualSocket Class | VirtualSocket Members | Org.Mentalis.Security.Ssl Namespace | VirtualSocket.Send Overload List