source: project/wiki/eggref/4/unix-sockets @ 15315

Last change on this file since 15315 was 15315, checked in by sjamaan, 12 years ago

Update unix-sockets changelog

File size: 3.4 KB
Line 
1[[tags: egg]]
2
3== unix-sockets
4
5[[toc:]]
6
7=== Description
8
9Simple access to UNIX domain sockets.
10
11=== Author
12
13[[/users/felix winkelmann|felix winkelmann]]
14
15=== Requirements
16
17[[easyffi]]
18
19=== Documentation
20
21The interface is similar to the builtin TCP socket functionality in CHICKEN.
22
23<procedure>(unix-listen PATHNAME [BACKLOG])</procedure>
24
25Creates a socket listener object. {{PATHNAME}} gives the name of the
26file that represents the connection. {{BACKLOG}} specifies how many
27pending connections are allowed and defaults to 10.
28
29<procedure>(unix-listener? X)</procedure>
30
31Returns {{#t}} if {{X}} is a unix socket listener object, or {{#f}} otherwise.
32
33<procedure>(unix-close LISTENER)</procedure>
34
35Closes the socket associated with the listener object.
36
37<procedure>(unix-accept LISTENER)</procedure>
38
39Waits for a connection from a client and returns two values: an input-
40and output-port which can be used to communicate with the connecting
41process. Calling {{unix-accept}} does not block other threads from
42running.
43
44<procedure>(unix-accept-ready? LISTENER)</procedure>
45
46Returns {{#t}} if a {{unix-accept}} for this listener would not block the current thread, or {{#f}}
47otherwise.
48
49
50<procedure>(unix-connect PATHNAME)</procedure>
51
52Connects to the socket given in {{PATHNAME}} and returns two values: an input- and output-port
53which allow communication with the server.
54
55<procedure>(unix-listener-fileno LISTENER)</procedure>
56
57Returns the file-descriptor of the socket associated with the given listener object.
58
59<procedure>(unix-listener-path LISTENER)</procedure>
60
61Returns the pathname of the socket associated with the given listener object.
62
63=== Changelog
64
65* 1.4 Do not import errno, to make it compatible with Chicken 4.1.0
66* 1.3 Applied bugfix by Shawn Wagner
67* 1.2 Added include for sys/time.h, which is needed on some systems [Thanks to Kon Lovett]
68* 1.1 Replaced use of {{(end-of-file)}} with {{#!eof}}
69* 1.0 Initial release
70
71=== License
72
73  Copyright (c) 2005, Felix L. Winkelmann
74  All rights reserved.
75 
76  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
77  conditions are met:
78 
79    Redistributions of source code must retain the above copyright notice, this list of conditions and the following
80      disclaimer.
81    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
82      disclaimer in the documentation and/or other materials provided with the distribution.
83    Neither the name of the author nor the names of its contributors may be used to endorse or promote
84      products derived from this software without specific prior written permission.
85 
86  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
87  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
88  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
89  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
90  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
91  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
92  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
93  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
94  POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.