Mercurial > projects > dreactor
comparison test/test.d @ 6:287ba7de97c4
more housekeeping
author | rick@minifunk |
---|---|
date | Tue, 08 Jul 2008 12:23:26 -0400 |
parents | f875a1f278b8 |
children |
comparison
equal
deleted
inserted
replaced
5:f875a1f278b8 | 6:287ba7de97c4 |
---|---|
2 | 2 |
3 import tango.net.Socket; | 3 import tango.net.Socket; |
4 import tango.core.Thread; | 4 import tango.core.Thread; |
5 import tango.io.Stdout; | 5 import tango.io.Stdout; |
6 import dreactor.core.Vat; | 6 import dreactor.core.Vat; |
7 import dreactor.core.ConnectionHandler; | 7 import dreactor.core.Dispatcher; |
8 import dreactor.protocol.RawTcp; | 8 import dreactor.protocol.RawTcp; |
9 import dreactor.transport.AsyncSocketConduit; | 9 import dreactor.transport.AsyncSocketConduit; |
10 | 10 |
11 int main() | 11 int main() |
12 { | 12 { |
13 AsyncSocketConduit cond = new AsyncSocketConduit; | 13 AsyncSocketConduit cond = new AsyncSocketConduit; |
14 ConnectionHandler lh = new ConnectionHandler(cond, true); | 14 Dispatcher lh = new Dispatcher(cond, true); |
15 Vat l_vat = new Vat(); | 15 Vat l_vat = new Vat(); |
16 RawTCPListener listener = new RawTCPListener(lh, l_vat, new IPv4Address(5555)); | 16 RawTCPListener listener = new RawTCPListener(lh, l_vat, new IPv4Address(5555)); |
17 l_vat.run(); | 17 l_vat.run(); |
18 | 18 |
19 AsyncSocketConduit clcond = new AsyncSocketConduit; | 19 AsyncSocketConduit clcond = new AsyncSocketConduit; |
20 ConnectionHandler ch = new ConnectionHandler(clcond); | 20 Dispatcher ch = new Dispatcher(clcond); |
21 Vat c_vat = new Vat(); | 21 Vat c_vat = new Vat(); |
22 RawTCPClient client = new RawTCPClient(ch, c_vat); | 22 RawTCPClient client = new RawTCPClient(ch, c_vat); |
23 c_vat.run(); | 23 c_vat.run(); |
24 | 24 |
25 client.connect(new IPv4Address("localhost", 5555)); | 25 client.connect(new IPv4Address("localhost", 5555)); |