NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

UDPClient.Send (Byte[], Int32, String, Int32)

Sends a UDP datagram to the specified port on the specified remote host.

[Visual Basic]
Overloads Public Function Send( _
   ByVal dgram() As Byte, _
   ByVal bytes As Integer, _
   ByVal hostname As String, _
   ByVal port As Integer _
) As Integer
[C#]
public int Send(
   byte[] dgram,
   int bytes,
   string hostname,
   int port
);
[C++]
public: int Send(
   unsigned char* dgram[],
   int bytes,
   String* hostname,
   int port
);
[JScript]
public function Send(
   dgram : Byte[],
   bytes : int,
   hostname : String,
   port : int
) : int;

Parameters

dgram
The UDP datagram to send.
bytes
The number of bytes in the datagram to send.
hostname
The remote host to connect to.
port
[To be supplied.]

Return Value

If successful, the number of bytes sent; otherwise an invalid socket error.

Exceptions

Exception Type Condition
ArgumentException The UDPClient is connected to a remote host.

Remarks

System.Net.Sockets.TCPClient.Send establishes a UDP connection to the host and port specified and sends the datagram. The data is sent the SendTo method of the underlying Socket instance.

See Also

UDPClient Class | UDPClient Members | System.Net.Sockets Namespace | UDPClient.Send Overload List