Table Of Contents

UDP Open (G Dataflow)

Last Modified: December 18, 2017

Opens a UDP socket to send a datagram to a single receiver on the port or service name you specify. If you want to send a single datagram to multiple receivers in parallel, which may reduce overhead both in code and on the network over sending a datagram to multiple receivers serially, use the UDP Multicast Open node instead of this one.

Programming Patterns
connector_pane_image
datatype_icon

net address

The network address of a network interface on the local device where this node listens for data.

  • If you do not specify a network address, the OS picks a default interface that is used to receive data. If the node is read/write and you do not specify a network address, this node sends and receives data on all interfaces.
  • If you have more than one network interface on your server, such as two Ethernet interfaces, you can specify an address so that this node listens for data only on the interface with that address.
  • If this input is on a node with write access, this is also the interface on which data will be transmitted.

Default: 0

datatype_icon

port

The local port you want to use to send and receive UDP datagrams.

datatype_icon

service name

The name you want to associate with the port number that this node is listening for connections on.

If you specify a service name, this node registers the service name and the associated port number with the NI Service Locator. A client can then use this service name to query the NI Service Locator for the port number associated with that service name. By using registered service names, clients can establish connections with the server without specifying a port number.

What Is the NI Service Locator?

The NI Service Locator stores a list of registered service names and returns a corresponding port number to clients that query for a particular service name.

A client can use a service name to query the NI Service Locator and obtain the port number associated with that service name. Thus, a client does not need to know the port number of a registered service in order to request that service.

The NI Service Locator runs as a background service and requires no user interaction.

Registering Services with the NI Service Locator

Use this input to register a service name and associated port number with the NI Service Locator.

datatype_icon

timeout ms

Time, in milliseconds, that the node waits to complete before reporting a timeout error.

Wire a -1 to this input to wait indefinitely.

Default: 25,000 ms

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

connection ID

A network connection refnum that uniquely identifies the connection. Use this value to refer to this connection in subsequent node calls.

datatype_icon

actual port

Port number the node used. If the input port is not zero, the output port number equals the input port number. Wire 0 to the port input to dynamically choose an available port the operating system determines is valid for use.

The following table lists valid port numbers as defined by the Internet Assigned Numbers Authority (IANA).

Type Range
System/Well-Known Ports 0 through 1023
User/Registered Ports 1024 through 49151
Dynamic/Private Ports 49152 through 65535
datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics