UdpOpen

This procedure requests acceptance of UDP datagrams on the specified socket and allows datagrams to be sent from the specified socket. When the socket port is unspecified, UDP selects a port and returns it to the socket port field. When the socket address is unspecified, UDP uses the default local address. If specified, the address must be a valid home address for your node.
Note: When the local address is specified, only the UDP datagrams addressed to it are delivered.

If the ReturnCode indicates the open was successful, use the returned ConnIndex value on any further actions pertaining to this UDP socket. Figure 1 shows an example.

Figure 1. UdpOpen example
   procedure UdpOpen
            (
       var  LocalSocket: SocketType;
       var  ConnIndex: ConnectionIndexType;
       var  ReturnCode: CallReturnCodeType
            );
            external;
Parameter
Description
LocalSocket
The local socket (address and port pair).
ConnIndex
The ConnIndex value returned from UdpOpen.
ReturnCode
Indicates success or failure of a call. Possible return values are:
  • OK
  • ABNORMALcondition
  • FATALerror
  • LOCALportNOTavailable
  • NObufferSPACE
  • NOTyetBEGUN
  • SOFTWAREerror
  • TCPipSHUTDOWN
  • UDPlocalADDRESS
  • TOOmanyOPENS
  • UNAUTHORIZEDuser

For a description of Pascal return codes, see Table 1.