![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
| sendto | 
| Portability: | UNIX compatible | 
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| PORTABILITY | |
| RELATED FUNCTIONS | 
| SYNOPSIS | 
#include <sys/types.h>
#include <sys/socket.h>
int sendto(int s, const void *buf, int len, int flags,
           const void *to, int addrlen);
| DESCRIPTION | 
sendto
 transmits a message from the area pointed to by 
buf
 of length 
len
 to socket descriptor 
s
. 
to
 is the target
address; 
addrlen
 is the
address size.  
sendto
 can
be used on any type of socket.  It is most commonly used for unconnected datagram
sockets for which different destinations may be associated with different
datagrams.
flags
consists of the following: 
MSG_OOB
MSG_DONTROUTE
| RETURN VALUE | 
If 
sendto
 succeeds, it returns the number of characters sent. If there
is an error, it returns a 
-1
.
| PORTABILITY | 
sendto
 is portable to other environments, including most UNIX systems,
that implement BSD sockets.
| RELATED FUNCTIONS | 
recv
, 
recvfrom
, 
recvmsg
, 
send
, 
sendmsg
, 
write
![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
![]() Top of Page  | 
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.