Sends data to a specific endpoint, starting at the indicated location in the data.
[Visual Basic]
Overridable Overloads Public Function SendTo( _
ByVal buffer As Byte(), _
ByVal remoteEP As EndPoint _
) As Integer
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, and the remote EndPoint. The offset defaults to 0. The size defaults to the buffer length, and SocketFlags value defaults to None.
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is a null reference (Nothing in Visual Basic). -or- The remoteEP parameter is a null reference (Nothing). |
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.SendTo Overload List