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

The sendto and recvfrom (or sendmsg and recvmsg) system calls are
usually used to transmit and receive messages.

Sending Messages

Use sendto or sendmsg to send messages. sendmsg allows the send
data to be gathered from several buffers.
If you have declared a default address, you can use send , sendto, or
sendmsg to send messages. If you use sendto or sendmsg in this special
case, be sure you specify 0 as the address value or an error will occur.
send is described in the "Sending Data" section in the "BSD Sockets:
Using Internet Stream Sockets" chapter of this guide and in the
send(2) man page. sendto and its parameters are described in the
following table.
Include files:
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
System call:
count = sendto(s,msg,len,flags,to,tolen) int s
char *msg;
int len, flags;
struct sockaddr *to
int tolen;
Parameter
Description of Contents
s
socket descriptor of local
socket
msg
pointer to data buffer
len
size of data buffer
Chapter 4
Using Internet Datagram Sockets
Sending and Receiving Messages
INPUT Value
socket descriptor of
socket sending message
pointer to data to be
sent
size of msg
95

Advertisement

Table of Contents
loading

Table of Contents