Mentalis.org Security Library documentation

VirtualSocket.SendTo Method (Byte[], EndPoint)

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
[C#]
public virtual int SendTo(
   byte[] buffer,
   EndPoint remoteEP
);

Parameters

buffer
The data to be sent.
remoteEP
The EndPoint representing the destination location for the data.

Return Value

The number of bytes sent.

Remarks

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.

Exceptions

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

See Also

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