Mercurial > projects > dreactor
diff test/async/test.d @ 12:d6a3cfe7c3de
more stuff
author | rick@Macintosh.local |
---|---|
date | Wed, 27 Aug 2008 00:47:33 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/async/test.d Wed Aug 27 00:47:33 2008 -0400 @@ -0,0 +1,30 @@ +module test; + +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() +{ + AsyncSocketConduit cond = new AsyncSocketConduit; + Dispatcher lh = new Dispatcher(cond, true); + Vat l_vat = new Vat(); + RawTCPListener listener = new RawTCPListener(lh, l_vat, new IPv4Address(5555)); + l_vat.run(); + + AsyncSocketConduit clcond = new AsyncSocketConduit; + Dispatcher ch = new Dispatcher(clcond); + Vat c_vat = new Vat(); + RawTCPClient client = new RawTCPClient(ch, c_vat); + c_vat.run(); + + client.connect(new IPv4Address("localhost", 5555)); + //Thread.sleep(1); + client.send("This is a test"); + return 0; +} +