SrecvDGRAM
Previous Topic  Next Topic 

Synopsis:

       SrecvDGRAM (socket, no_bytes, pAddr, pPort ,timeout_10ths ,&pData_buf)


Arguments:

       socket - The socket handle

       no_bytes - The maximum number of bytes of data to receive

       pAddr - The IP address of the sending party

       pPort - The IP port of the sending party

       timeout_10ths -  The timeout (in 1/10th seconds) to wait for a message to arrive

       [&pData_buf] - Optional pointer to a variable that will hold the received datagram


Description:   This function allows datagram messages to be received up to the number of bytes specified by the no_bytes argumnent.    If there is less than no_bytes of data waiuting then the function will retrieve this data     The socket handle specifies a datagram socket handle opened using SopenDGRAM().       If a timeout is specified in the timeout_10ths argument then the function will block until some data has been received or the timeout expires (After which it would return EWOULDBLOCk(-3)).        If a zeero timeout is specified then the function will return immediately with EWOULDBLOCK if there is no data available.   If a negative timeout is specified then the function will wait indefinitely for data to arrivet the socket.



If the optional argument pData_buf is specified then all received data will be returned in the variable pointed to by this argument (and the function will return 0 to indicate that data has been received.      If the pData_buf argument is not specified the function will return the data received as the return value.    



Returns:    If pData_buf is specified then the function will return 0 if data was received or -3 (EWOULDBLOCK) if there was no data waiting, or a negative error value.


If pData_buf is not specified then the function will return the actual data received or or -3 (EWOULDBLOCK) if there was no data waiting, or a negative error value.