Sends data to a specific endpoint, starting at the indicated location in the data.
The number of bytes sent.
If you are using a connection-oriented protocol or a connected Socket using a connectionless protocol, remoteEP overrides the endpoint specified in RemoteEndPoint. If you are using an unconnected Socket with a connectionless protocol, this method sets the LocalEndPoint property of the current instance to a value determined by the protocol. You must subsequently receive data on the LocalEndPoint.
This overload only requires you to provide a data buffer, SocketFlags, the number bytes to be sent and the remote EndPoint. The offset defaults to 0.
Note 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 buffer is greater than the maximum message size of the underlying protocol, no data is sent and Socket will throw a SocketException. If you are using a connection-oriented Socket, remoteEp is ignored.
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is a null reference (Nothing in Visual Basic). -or- The remoteEP parameter is a null reference (Nothing). |
ArgumentOutOfRangeException | The specified size exceeds the size of buffer. |
SocketException | An operating system error occurs while accessing the socket. |
ObjectDisposedException | The VirtualSocket has been closed. |
VirtualSocket Class | Org.Mentalis.Security.Ssl Namespace | VirtualSocket.SendTo Overload List