7
|
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
|