Mercurial > projects > dreactor
diff test/chatserver.d @ 7:2c6ab06a8829
fixed up for chatserver
author | rick@minifunk |
---|---|
date | Wed, 09 Jul 2008 00:32:11 -0400 |
parents | |
children | 5412a1ff2e49 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/chatserver.d Wed Jul 09 00:32:11 2008 -0400 @@ -0,0 +1,26 @@ +module chatserver; + +import tango.net.Socket; +import tango.core.Thread; +import tango.io.Stdout; +import dreactor.core.Vat; +import dreactor.core.Dispatcher; + +import dreactor.protocol.RawTcp; +import dreactor.transport.AsyncSocketConduit; + + +int main() +{ + Vat l_vat = new Vat(); + RawTCPListener listener = new RawTCPListener(l_vat, new IPv4Address(5555)); + listener.setDataHandler( (char[] inbuf, Dispatcher d) { + + listener.broadcast(inbuf, [d]); + + }); + l_vat.run(); + + return 0; +} +