HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 137
When to Send Data
![]() |
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 137 highlights
Using UNIX Domain Stream Sockets Sending and Receiving Data Function result: number of bytes actually sent, -1 if failure occurs. Example: count = send (s, buf, 10, 0); send blocks until the specified number of bytes have been queued to be sent, unless you are using nonblocking I/O. When to Send Data The server or client process should send data after connection is established. Refer to the send(2) man page for more information on send. Receiving Data recv and its parameters are described in the following table. Include files: System call: #include #include count = recv(s,buf,len,flags) int s; char *buf; int len, flags; Parameter Description of Contents INPUT Value s buf len flags socket descriptor of local socket pointer to data buffer maximum number of bytes that should be received settings for optional flags socket descriptor of socket sending data pointer to data to be sent size of data buffer 0 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. Chapter 6 137
![](/manual_guide/products/hewlettpackard-rp5405-bsd-sockets-interface-programmers-guide-5276e7d/137.png)