UdpSend
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.
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.