1SCTP_PEELOFF(3)            Linux Programmer's Manual           SCTP_PEELOFF(3)
2
3
4

NAME

6       sctp_peeloff - Branch off an association into a separate socket.
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <sys/socket.h>
11       #include <netinet/sctp.h>
12
13       int sctp_peeloff(int sd, sctp_assoc_t assoc_id);
14       int sctp_peeloff_flags(int sd, sctp_assoc_t assoc_id, unsigned flags);
15

DESCRIPTION

17       sctp_peeloff branches off an existing association assoc_id on a one-to-
18       many style socket sd into a separate socket. The new socket is  a  one-
19       to-one style socket.
20
21       This  is  particularly  desirable  when,  for instance, the application
22       wishes to have a number of sporadic  message  senders/receivers  remain
23       under the original one-to-many style socket, but branch off those asso‐
24       cations carrying high volume  data  traffic  into  their  own  separate
25       socket descriptors.
26
27       sctp_peeloff_flags  is  a  variant  of  sctp_peeloff,  in  which  flags
28       describing the behavior of the newly peeled off socket  can  be  speci‐
29       fied.  Currently the supported flags are:
30
31       SOCK_NONBLOCK
32              Specifies that the new socket should not block on io operations.
33
34       SOCK_CLOEXEC
35              Specifies  that  the new socket should be closed when the owning
36              process calls exec.
37

RETURN VALUE

39       On success, the new socket  descriptor  representing  the  branched-off
40       asociation  is  returned.   On  error, -1 is returned, and errno is set
41       appropriately.
42

ERRORS

44       EBADF  sd is not a valid descriptor.
45
46       EINVAL The assoc id passed is invalid or if the socket is a  one-to-one
47              style socket.
48
49       ENOTSOCK
50              Argument is a descriptor for a file, not a socket.
51

NOTES

53       sctp_peeloff_flags  is a linux specific variant of sctp_peeloff.  While
54       it will compile on other systems, its  use  will  result  in  an  error
55       return.  Portable code should use sctp_peeloff.
56

SEE ALSO

58       sctp(7)      sctp_bindx(3),      sctp_connectx(3),     sctp_sendmsg(3),
59       sctp_sendv(3), sctp_send(3), sctp_recvmsg(3), sctp_recvv(3),  sctp_get‐
60       paddrs(3), sctp_getladdrs(3), sctp_opt_info(3),
61
62
63
64Linux 2.6                         2005-10-25                   SCTP_PEELOFF(3)
Impressum