HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 98
Or Msg_peek
![]() |
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 98 highlights
Using Internet Datagram Sockets Sending and Receiving Messages Parameter flags from fromlen Contents settings for optional flags address of socket that sent message pointer to the size of from INPUT Value 0 or MSG_PEEK pointer to address structure, not used for input pointer to size of from OUTPUT Value unchanged pointer to socket address of socket that sent the message pointer to the actual size of address returned Function result: Number of bytes actually received, -1 if an error occurs. Example: addrlen = sizeof(sockaddr_in); ... count = recvfrom(s, buffer, BUFFERSIZE, 0, clientaddr, &addrlen); recvfrom blocks until there is a message to be received. No more than len bytes of data are returned. The entire message is read in one recvfrom, recvmsg, recv or read operation. If the message is too long for the allocated buffer, the excess data are discarded. Because only one message can be returned in a recvfrom call, if a second message is in the queue, it is not affected. Therefore, the best technique is to receive as much as possible on each call. The host does not wait for len bytes to be available; if less than len bytes are available, that number of bytes are returned. Flag Options The flag options are: • 0 for no options. 98 Chapter 4
![](/manual_guide/products/hewlettpackard-rp5405-bsd-sockets-interface-programmers-guide-5276e7d/98.png)