Mercurial > projects > dreactor
comparison test/chatserver.d @ 7:2c6ab06a8829
fixed up for chatserver
author | rick@minifunk |
---|---|
date | Wed, 09 Jul 2008 00:32:11 -0400 |
parents | |
children | 5412a1ff2e49 |
comparison
equal
deleted
inserted
replaced
6:287ba7de97c4 | 7:2c6ab06a8829 |
---|---|
1 module chatserver; | |
2 | |
3 import tango.net.Socket; | |
4 import tango.core.Thread; | |
5 import tango.io.Stdout; | |
6 import dreactor.core.Vat; | |
7 import dreactor.core.Dispatcher; | |
8 | |
9 import dreactor.protocol.RawTcp; | |
10 import dreactor.transport.AsyncSocketConduit; | |
11 | |
12 | |
13 int main() | |
14 { | |
15 Vat l_vat = new Vat(); | |
16 RawTCPListener listener = new RawTCPListener(l_vat, new IPv4Address(5555)); | |
17 listener.setDataHandler( (char[] inbuf, Dispatcher d) { | |
18 | |
19 listener.broadcast(inbuf, [d]); | |
20 | |
21 }); | |
22 l_vat.run(); | |
23 | |
24 return 0; | |
25 } | |
26 |