CreateUDPChannel
int CreateUDPChannel (unsigned int localPort, unsigned int *channel);
Purpose
Creates a UDP channel object that you can use to send and/or receive UDP datagrams.
You must create a UDP channel object to send or receive any unicast, multicast, or broadcast messages. The new channel can receive messages sent only to the specified port number, though it can send messages to any port.
You must call DisposeUDPChannel to free resources when you finish using the channel.
Calling CreateUDPChannel is equivalent to calling CreateUDPChannelConfig with the following parameters:
CreateUDPChannelConfig (localport, UDP_ANY_ADDRESS, 1, NULL, NULL, channel)
Parameters
Input | ||||
Name | Type | Description | ||
localPort | unsigned int | The local port number to open for UDP communication.
Applications must agree on the port number(s) to use for communication. According to the Internet Assigned Numbers Authority (IANA), do not use ports in the Well Known (0-1023) or Registered (1024-49151) ranges without IANA registration. Instead, use port numbers in the Dynamic/Private range: 49152-65535.
|
||
Output | ||||
Name | Type | Description | ||
channel | unsigned int | A handle that uniquely identifies a UDP channel object. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful.
Zero indicates successful execution and a negative number indicates that an error occurred. Call the GetUDPErrorString function to obtain a message that describes the error. |
Additional Information
Library: UDP Support Library
Include file: udpsupp.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later