UdpReceive

The procedure shown in Figure 1 notifies the TCP/IP address space that you are willing to receive UDP datagram data.

UdpReceive is for compatibility with old programs only. New programs should use the UdpNReceive procedure, which allows you to specify the size of your buffer.

If you use UdpReceive, TCP/IP can put a datagram as large as 2012 bytes in your buffer. If a larger datagram is sent to your port when UdpReceive is pending, the datagram is discarded without notification.
Note: No data is transferred from the TCP/IP address space in this call. It only tells TCP/IP that you are waiting for a datagram. Data has been transferred when a UDPdatagramDELIVERED notification is received.
Figure 1. UdpReceive example
   procedure UdpReceive
            (
                 ConnIndex: ConnectionIndexType;
                 DatagramAddress: integer;
        var    ReturnCode: CallReturnCodeType
            );
            external;
Parameter
Description
ConnIndex
The ConnIndex value returned from UdpOpen.
DatagramAddress
The address of your buffer that is filled with a UDP datagram.
ReturnCode
Indicates success or failure of a call:
  • OK
  • ABNORMALcondition
  • FATALerror
  • NOsuchCONNECTION
  • NOTyetBEGUN
  • SOFTWAREerror
  • TCPipSHUTDOWN
  • INVALIDvirtualADDRESS

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