Sending And Receiving Data; Sending Data - 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

Sending 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 recv and send) 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:
• If you use read and write instead of send and recv, you can use a
socket for stdin or stdout.
• If you use read and write instead of send and recv, you cannot use
the options specified with the send or recv flags parameter.
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.

Sending Data

send and its parameters are described in the following table.
Include files:
#include <sys/types.h>
#include <sys/socket.h>
System call:
count = send(s,msg,len,flags)
int s;
char *msg;
int len, flags;
Parameter
s
socket descriptor of local
socket
Chapter 2
Description of
Contents
Using Internet Stream Sockets
Sending and Receiving Data
INPUT Value
socket descriptor of socket
sending data
43

Advertisement

Table of Contents
loading

Table of Contents