1socket_send6(3)            Library Functions Manual            socket_send6(3)
2
3
4

NAME

6       socket_send6 - send a UDP datagram
7

SYNTAX

9       #include <socket.h>
10
11       ssize_t socket_send6(int s, const char* buf, size_t len,
12                const char ip[16], uint16 port, uint32 scope_id);
13

DESCRIPTION

15       socket_send6 sends len bytes starting at buf in a UDP datagram over the
16       socket s to UDP port port on IP address ip.
17
18       You can call socket_send6 without calling socket_bind6.  This  has  the
19       effect as first calling socket_bind6 with IP address :: and port 0.
20
21       The meaning of scope_id is dependent on the implementation and IPv6 IP.
22       On link-local IPv6 addresses it specifies the outgoing interface index.
23       The  name (e.g. "eth0") for a given interface index can be queried with
24       getifname.  scope_id should normally be set to 0.
25

RETURN VALUE

27       socket_send6 returns 0 if the datagram was sent successfully.  If  not,
28       it returns -1 and sets errno appropriately.
29

EXAMPLE

31         #include <socket.h>
32
33         int s;
34         char ip[16];
35         uint16 p;
36         uint32 scope_id;
37
38         s = socket_tcp4();
39         socket_bind6(s,ip,p);
40         socket_send6(s,"hello, world",12,ip,p,scope_id);
41
42

SEE ALSO

44       socket_send4(3), socket_getifidx(3)
45
46
47
48                                                               socket_send6(3)
Impressum