Bug 1885489 - Part 9: Add SnapshotIterator::readObject(). r=iain
[gecko.git] / docs / nspr / reference / prsocketoptiondata.rst
blob442d1559e953eec7ab6e4932ed7fe324f85613ed
1 PRSocketOptionData
2 ==================
4 Type for structure used with :ref:`PR_GetSocketOption` and
5 :ref:`PR_SetSocketOption` to specify options for file descriptors that
6 represent sockets.
9 Syntax
10 ------
12 .. code::
14    #include <prio.h>
16    typedef struct PRSocketOptionData
17    {
18      PRSockOption option;
19      union
20      {
21         PRUintn ip_ttl;
22         PRUintn mcast_ttl;
23         PRUintn tos;
24         PRBool non_blocking;
25         PRBool reuse_addr;
26         PRBool keep_alive;
27         PRBool mcast_loopback;
28         PRBool no_delay;
29         PRSize max_segment;
30         PRSize recv_buffer_size;
31         PRSize send_buffer_size;
32         PRLinger linger;
33         PRMcastRequest add_member;
34         PRMcastRequest drop_member;
35         PRNetAddr mcast_if;
36      } value;
37    } PRSocketOptionData;
40 Fields
41 ~~~~~~
43 The structure has the following fields:
45 ``ip_ttl``
46    IP time-to-live.
47 ``mcast_ttl``
48    IP multicast time-to-live.
49 ``tos``
50    IP type-of-service and precedence.
51 ``non_blocking``
52    Nonblocking (network) I/O.
53 ``reuse_addr``
54    Allow local address reuse.
55 ``keep_alive``
56    Periodically test whether connection is still alive.
57 ``mcast_loopback``
58    IP multicast loopback.
59 ``no_delay``
60    Disable Nagle algorithm. Don't delay send to coalesce packets.
61 ``max_segment``
62    TCP maximum segment size.
63 ``recv_buffer_size``
64    Receive buffer size.
65 ``send_buffer_size``
66    Send buffer size.
67 ``linger``
68    Time to linger on close if data are present in socket send buffer.
69 ``add_member``
70    Join an IP multicast group.
71 ``drop_member``
72    Leave an IP multicast group.
73 ``mcast_if``
74    IP multicast interface address.
77 Description
78 ~~~~~~~~~~~
80 :ref:`PRSocketOptionData` is a name-value pair for a socket option. The
81 ``option`` field (of enumeration type :ref:`PRSockOption`) specifies the
82 name of the socket option, and the ``value`` field (a union of all
83 possible values) specifies the value of the option.