Mercurial > projects > dreactor
comparison test/async/test.d @ 12:d6a3cfe7c3de
more stuff
author | rick@Macintosh.local |
---|---|
date | Wed, 27 Aug 2008 00:47:33 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:5836613d16ac | 12:d6a3cfe7c3de |
---|---|
1 module test; | |
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 import dreactor.protocol.RawTcp; | |
9 import dreactor.transport.AsyncSocketConduit; | |
10 | |
11 int main() | |
12 { | |
13 AsyncSocketConduit cond = new AsyncSocketConduit; | |
14 Dispatcher lh = new Dispatcher(cond, true); | |
15 Vat l_vat = new Vat(); | |
16 RawTCPListener listener = new RawTCPListener(lh, l_vat, new IPv4Address(5555)); | |
17 l_vat.run(); | |
18 | |
19 AsyncSocketConduit clcond = new AsyncSocketConduit; | |
20 Dispatcher ch = new Dispatcher(clcond); | |
21 Vat c_vat = new Vat(); | |
22 RawTCPClient client = new RawTCPClient(ch, c_vat); | |
23 c_vat.run(); | |
24 | |
25 client.connect(new IPv4Address("localhost", 5555)); | |
26 //Thread.sleep(1); | |
27 client.send("This is a test"); | |
28 return 0; | |
29 } | |
30 |