|
|
HP 9000 Networking: BSD Sockets Interface Programmer's Guide > Chapter 6 Using UNIX Domain Stream SocketsSending and Receiving Data |
|
After the connect and accept calls are successfully executed, the connection is established and data can be sent and received between the two socket endpoints. Because the stream socket descriptors correspond to HP-UX file descriptors, you can use the read and write calls (in addition to send and recv) to pass data through a socket-terminated channel. If you are considering the use of the read and write system calls instead of the send and recv calls described below, you should consider the following:
See the table that lists other system calls in chapter 8, for more information on which of these system calls are best for your application. send and its parameters are described in the following table.
send blocks until the specified number of bytes have been queued to be sent, unless you are using nonblocking I/O. recv and its parameters are described in the following table.
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. |
|