From ee937667fd0ecd82faab4c88d756b906fb625f1a Mon Sep 17 00:00:00 2001 From: sc Date: Tue, 28 Nov 2000 17:07:47 +0000 Subject: Integration into IvyLeague Uvh -> Ivl Multiplexer.* is renamed into Scheduler.* A few name conflicts in the merger with ex-DNN have been solved Imakefile is replaced by Makefile Created InetAddress.* and UnixAddress.* from Address.* Created IrdaAddress.* OLD/TextStream has been updated --- comm/test.cc | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'comm/test.cc') diff --git a/comm/test.cc b/comm/test.cc index a6dfabf..ac5faca 100644 --- a/comm/test.cc +++ b/comm/test.cc @@ -6,35 +6,35 @@ #define TESTMSG #ifdef TESTMSG -class MyRemoteAgent : public UchRemoteAgent { +class MyRemoteAgent : public IvlRemoteAgent { public: - MyRemoteAgent (UchAgent* a, UchChannel* ch) : UchRemoteAgent (a, ch) {} + MyRemoteAgent (IvlAgent* a, IvlChannel* ch) : IvlRemoteAgent (a, ch) {} ~MyRemoteAgent () {} -bool NewMessage (UchMsgBuffer&, bool); +bool NewMessage (IvlMsgBuffer&, bool); }; -class MyAgent : public UchAgent { +class MyAgent : public IvlAgent { public: - MyAgent (UchAddress* a) : UchAgent (a) {} + MyAgent (IvlAddress* a) : IvlAgent (a) {} ~MyAgent () {} -UchRemoteAgent* HandleNew (UchChannel* ch) { return new MyRemoteAgent (this, ch); } +IvlRemoteAgent* HandleNew (IvlChannel* ch) { return new MyRemoteAgent (this, ch); } }; -class MyMsg : public UchMessage { - CcuString S1; - CcuString S2; +class MyMsg : public IvlMessage { + IvlString S1; + IvlString S2; public: - MyMsg (const char* s1, const char* s2) : UchMessage (), S1 (s1), S2 (s2) {} - MyMsg () : UchMessage (), S1 ("S1"), S2 ("S2") {} + MyMsg (const char* s1, const char* s2) : IvlMessage (), S1 (s1), S2 (s2) {} + MyMsg () : IvlMessage (), S1 ("S1"), S2 ("S2") {} ~MyMsg () {} - void ReadFrom (UchMsgBuffer&, lword); - void WriteTo (UchMsgBuffer&); + void ReadFrom (IvlMsgBuffer&, lword); + void WriteTo (IvlMsgBuffer&); void Dump () { printf ("[%s] [%s]\n", (const char*) S1, (const char*) S2); } }; bool -MyRemoteAgent :: NewMessage (UchMsgBuffer& b, bool) +MyRemoteAgent :: NewMessage (IvlMsgBuffer& b, bool) { MyMsg m; b.Get (m); @@ -43,30 +43,30 @@ MyRemoteAgent :: NewMessage (UchMsgBuffer& b, bool) } void -MyMsg :: WriteTo (UchMsgBuffer& b) +MyMsg :: WriteTo (IvlMsgBuffer& b) { b << S1 << S2; } void -MyMsg :: ReadFrom (UchMsgBuffer& b, lword len) +MyMsg :: ReadFrom (IvlMsgBuffer& b, lword len) { b >> S1 >> S2; } #endif -UchAgent* A; -UchPortServer* PS; +IvlAgent* A; +IvlPortServer* PS; const char* BUF; int fMatch (const char* match, lword host, sword port, const char*) { printf ("0x%lx:%d -> %s\n", host, port, match); - UchInetAddress* addr = new UchInetAddress (host == UchInetAddress::LoopBack () + IvlInetAddress* addr = new IvlInetAddress (host == IvlInetAddress::LoopBack () ? LOOPBACK : host, port); - UchRemoteAgent* ra = A->Contact (addr); + IvlRemoteAgent* ra = A->Contact (addr); if (ra) { printf ("joined\n"); #ifdef TESTMSG @@ -84,7 +84,7 @@ void fQuit (int, int) { printf ("quit\n"); - PS->Remove (BUF, *(UchInetAddress*) A->BoundTo ()); + PS->Remove (BUF, *(IvlInetAddress*) A->BoundTo ()); exit (0); } @@ -97,15 +97,15 @@ fTick (Millisecond t) main (int argc, char** argv) { const char* id = argc > 1 ? argv [1] : ""; - UchInetAddress addr (ANYADDR); + IvlInetAddress addr (ANYADDR); #ifdef TESTMSG MyAgent a (&addr); #else - UchAgent a (&addr); + IvlAgent a (&addr); #endif if (a.Setup ()) { A = &a; - UchPortServer ps ("portserv"); + IvlPortServer ps ("portserv"); PS = &ps; ps.Match ("portserv:chatty", fMatch); char buf [64]; @@ -113,10 +113,10 @@ main (int argc, char** argv) strcat (buf, id); BUF = buf; printf ("registering as %s\n", buf); - ps.Register (buf, *(UchInetAddress*) a.BoundTo ()); - UchSignalHandler h (*a.GetMultiplexer (), SigHup, fQuit); -// UchTimeOut to (*a.GetMultiplexer (), 1000, fTick); + ps.Register (buf, *(IvlInetAddress*) a.BoundTo ()); + IvlSignalHandler h (*a.GetMultiplexer (), SigHup, fQuit); +// IvlTimeOut to (*a.GetMultiplexer (), 1000, fTick); a.Run (); - ps.Remove (buf, *(UchInetAddress*) a.BoundTo ()); + ps.Remove (buf, *(IvlInetAddress*) a.BoundTo ()); } } -- cgit v1.1