Flag Options - HP Rp3440-4 - 9000 - 0 MB RAM Programmer's Manual

Bsd sockets interface programmer’s guide
Hide thumbs Also See for Rp3440-4 - 9000 - 0 MB RAM:
Table of Contents

Advertisement

Parameter
s
socket descriptor of local
socket
buf
pointer to data buffer
len
maximum number of
bytes that should be
received
flags
settings for optional flags
Function result: number of bytes actually received, –1 if failure occurs.
Example:
count = recv(s, buf, 10, 0);
recv blocks until there is at least 1 byte of data to be received, unless
you are using nonblocking I/O. The host does not wait for len bytes to be
available; if less than len bytes are available, that number of bytes are
received.
No more than len bytes of data are received. If there are more than len
bytes of data on the socket, the remaining bytes are received on the next
recv.

Flag Options

The flag options are:
• 0 for no options.
• MSG_OOB for out of band data.
• MSG_PEEK for a nondestructive read .
Use the MSG_OOB option if you want to receive out of band data. Refer
to the "Sending and Receiving Out of Band Data" section of chapter 3,
"Advanced Topics for Stream Sockets," for more information.
Chapter 2
Description of
Contents
Using Internet Stream Sockets
Sending and Receiving Data
INPUT Value
socket descriptor of socket
receiving data
pointer to buffer that is to
receive data
size of data buffer
0, MSG_OOB or
MSG_PEEK
45

Advertisement

Table of Contents
loading

Table of Contents