Sends a UDP datagram to the host at the remote end point.
[Visual Basic] Overloads Public Function Send( _ ByVal dgram() As Byte, _ ByVal bytes As Integer, _ ByVal ep As IPEndPoint _ ) As Integer [C#] public int Send( byte[] dgram, int bytes, IPEndPoint ep ); [C++] public: int Send( unsigned char* dgram[], int bytes, IPEndPoint* ep ); [JScript] public function Send( dgram : Byte[], bytes : int, ep : IPEndPoint ) : int;
If successful, the number of bytes sent; otherwise an invalid socket error.
Exception Type | Condition |
---|---|
ArgumentException | The UDPClient is connected to a remote host. |
System.Net.Sockets.TCPClient.Send establishes a UDP connection to the host referenced by the System.Net.Sockets.IPEndPoint and sends the datagram. The data is sent the SendTo method of the underlying Socket instance.
UDPClient Class | UDPClient Members | System.Net.Sockets Namespace | UDPClient.Send Overload List