summaryrefslogtreecommitdiff
path: root/doc/xs_close.txt
blob: 99b1ed898085a3b11dedf8dad443ce466d1da469 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
xs_close(3)
===========


NAME
----
xs_close - close Crossroads socket


SYNOPSIS
--------
*int xs_close (void '*socket');*


DESCRIPTION
-----------
The _xs_close()_ function shall destroy the socket referenced by the 'socket'
argument. Any outstanding messages physically received from the network but not
yet received by the application with _xs_recv()_ shall be discarded. The
behaviour for discarding messages sent by the application with _xs_send()_ but
not yet physically transferred to the network depends on the value of the
_XS_LINGER_ socket option for the specified 'socket'.

NOTE: The default setting of _XS_LINGER_ does not discard unsent messages;
this behaviour may cause the application to block when calling _xs_term()_.
For details refer to linkxs:xs_setsockopt[3] and linkxs:xs_term[3].


RETURN VALUE
------------
The _xs_close()_ function shall return zero if successful. Otherwise it shall
return `-1` and set 'errno' to one of the values defined below.


ERRORS
------
*ENOTSOCK*::
The provided 'socket' was invalid.


SEE ALSO
--------
linkxs:xs_socket[3]
linkxs:xs_term[3]
linkxs:xs_setsockopt[3]
linkxs:xs[7]


AUTHORS
-------
The Crossroads documentation was written by Martin Sustrik <sustrik@250bpm.com>
and Martin Lucina <martin@lucina.net>.