z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


UdpSend

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The procedure shown in Figure 1 sends a UDP datagram to the specified foreign socket. The source socket is the local socket selected in the UdpOpen that returned the ConnIndex value that was used. The buffer does not include the UDP header. This header is supplied by TCP/IP.

When there is no buffer space to process the data, an error is returned. In this case, wait for a subsequent UDPdatagramSPACEavailable notification.

Figure 1. UdpSend example
   procedure UdpSend
            (
                 ConnIndex: ConnectionIndexType;
                 ForeignSocket: SocketType;
                 BufferAddress: integer;
                 Length: integer;
        var    ReturnCode: CallReturnCodeType
            );
            external;
Parameter
Description
ConnIndex
The ConnIndex value returned from UdpOpen.
ForeignSocket
The foreign socket (address and port) to which the datagram is to be sent.
BufferAddress
The address of your buffer containing the UDP datagram to be sent, excluding UDP header.
Length
The length of the datagram to be sent, excluding UDP header. Maximum is 65507 bytes.
ReturnCode
Indicates success or failure of a call. Possible return values are:
  • OK
  • BADlengthARGUMENT
  • NObufferSPACE
  • NOsuchCONNECTION
  • NOTyetBEGUN
  • SOFTWAREerror
  • TCPipSHUTDOWN
  • UDPunspecADDRESS
  • UDPunspecPORT
  • INVALIDvirtualADDRESS

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

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014