-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
74 lines (42 loc) · 1.83 KB
/
README
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
TCP_LISTENER
============
This software, tcp_listener, is a generic non-blocking TCP listener framework.
The main usage is to write non-blocking TCP servers without needing to think
about all the small details about non-blocking TCP listeners and acceptors,
thusly following the "generic practice" often found in Erlang/OTP.
Source tracking is available at
http://gitorious.org/avtobiff/tcp_listener
To clone the main developing repository invoke
git clone git://gitorious.org/avtobiff/tcp_listener.git
DEPENDENCIES
------------
In order to build and run tcp_listener Erlang/OTP is needed. On Debian based
systems install erlang by invoking
sudo aptitude install erlang
For more information see Erlang's home on the internets
http://erlang.org/
BUILD AND INSTALL
-----------------
To build tcp_listener simply run
make
Optionally install it to the system Erlang lib directory (/usr/lib/erlang/lib)
by invoking
sudo make install
To change PREFIX of installation do (default PREFIX is /usr)
sudo make PREFIX=/usr/local install
USAGE
-----
The server need only to implement the gen_tcp_acceptor behaviour and then start
the tcp_listener with this module as argument
tcp_listener:start_link({local, my_server}, %% Name
my_server_module, %% Module -- acceptor
[{port, 8000}], %% Args
[]) %% Opts -- generally not used
See the edoc in the source code for documentation and also the examples
directory for examples on how to use tcp_listener.
INSPIRATION
-----------
http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles
http://github.com/erlware/gen_socket
http://github.com/kaos/gen_listener_tcp
-- Per Andersson <avtobiff@gmail.com> Mon, 14 Feb 2011 10:19:39 +0100