summaryrefslogtreecommitdiff
path: root/comm
diff options
context:
space:
mode:
authorchatty2000-11-28 17:00:54 +0000
committerchatty2000-11-28 17:00:54 +0000
commit4c26f7000135a6184a36c6c416ce625d21d43382 (patch)
tree6811db5dc1863ed7cfdc3d343abc94369f342497 /comm
parent1766d5847c86de962190224b94ee71e208fc5862 (diff)
downloadivy-league-4c26f7000135a6184a36c6c416ce625d21d43382.zip
ivy-league-4c26f7000135a6184a36c6c416ce625d21d43382.tar.gz
ivy-league-4c26f7000135a6184a36c6c416ce625d21d43382.tar.bz2
ivy-league-4c26f7000135a6184a36c6c416ce625d21d43382.tar.xz
*** empty log message ***
Diffstat (limited to 'comm')
-rwxr-xr-xcomm/FIGURES/buffer.tex37
-rwxr-xr-xcomm/FIGURES/clientserver.tex33
-rwxr-xr-xcomm/FIGURES/evreq.tex23
-rwxr-xr-xcomm/FIGURES/socketclasses.tex14
-rwxr-xr-xcomm/essai13
-rw-r--r--comm/test.cc122
6 files changed, 107 insertions, 135 deletions
diff --git a/comm/FIGURES/buffer.tex b/comm/FIGURES/buffer.tex
new file mode 100755
index 0000000..d17e56a
--- /dev/null
+++ b/comm/FIGURES/buffer.tex
@@ -0,0 +1,37 @@
+\setlength{\unitlength}{0.11mm}
+\begin{picture}(1060,420)(-540,400)
+\put(280,720){\small\sf $<<$ ...}
+\put(-240,720){\small\sf $>>$ ...}
+\put(200,440){}
+\put(280,760){\small\sf Append (...)}
+\put(-240,760){\small\sf Get (...)}
+\put(260,740){\thicklines\vector(-3,-4){80}}
+\put(-340,640){\thicklines\vector(3,4){80}}
+\put(120,560){\line(1,1){40}}
+\put(80,560){\line(1,1){80}}
+\put(40,560){\line(1,1){120}}
+\put(0,560){\line(1,1){120}}
+\put(-40,560){\line(1,1){120}}
+\put(-80,560){\line(1,1){120}}
+\put(-120,560){\line(1,1){120}}
+\put(-160,560){\line(1,1){120}}
+\put(-200,560){\line(1,1){120}}
+\put(-240,560){\line(1,1){120}}
+\put(-280,560){\line(1,1){120}}
+\put(-320,560){\line(1,1){120}}
+\put(-360,560){\line(1,1){120}}
+\put(-360,600){\line(1,1){80}}
+\put(-360,640){\line(1,1){40}}
+\put(440,500){\vector(1,0){40}}
+\put(200,500){\vector(-1,0){40}}
+\put(-20,500){\vector(1,0){180}}
+\put(-260,500){\vector(-1,0){100}}
+\put(-400,440){\small\sf Buffer ()}
+\put(120,440){\small\sf Free ()}
+\put(200,500){\small\sf FreeLength ()}
+\put(-240,500){\small\sf BufLength ()}
+\put(160,480){\vector(0,1){80}}
+\put(-360,480){\vector(0,1){80}}
+\put(-360,560){\framebox(520,120){}}
+\put(-500,560){\framebox(980,120){}}
+\end{picture}
diff --git a/comm/FIGURES/clientserver.tex b/comm/FIGURES/clientserver.tex
new file mode 100755
index 0000000..0ad043c
--- /dev/null
+++ b/comm/FIGURES/clientserver.tex
@@ -0,0 +1,33 @@
+\setlength{\unitlength}{0.11mm}
+\begin{picture}(1040,668)(-460,160)
+\put(-360,580){\line(1,0){40}}
+\put(-360,480){\line(1,0){40}}
+\put(-360,380){\line(1,0){40}}
+\put(-360,640){\line(0,-1){260}}
+\put(280,200){\small clients}
+\put(-300,200){\small server}
+\put(60,240){\small network}
+\put(120,340){\line(1,0){200}}
+\put(-140,380){\line(1,0){260}}
+\put(120,420){\thicklines\line(0,-1){140}}
+\put(420,340){\oval(280,160)}
+\put(-140,480){\line(5,1){300}}
+\put(-140,580){\line(2,1){300}}
+\put(260,540){\oval(280,160)}
+\put(260,720){\oval(280,160)}
+\put(320,300){\framebox(200,80){}}
+\put(160,500){\framebox(200,80){}}
+\put(160,680){\framebox(200,80){}}
+\put(340,320){\small\sf SERVICE}
+\put(180,520){\small\sf SERVICE}
+\put(180,700){\small\sf SERVICE}
+\put(-250,530){\oval(380,460)}
+\put(-320,340){\framebox(180,80){}}
+\put(-320,440){\framebox(180,80){}}
+\put(-320,540){\framebox(180,80){}}
+\put(-380,640){\framebox(200,80){}}
+\put(-300,360){\small\sf CLIENT}
+\put(-300,460){\small\sf CLIENT}
+\put(-300,560){\small\sf CLIENT}
+\put(-360,660){\small\sf SERVER}
+\end{picture}
diff --git a/comm/FIGURES/evreq.tex b/comm/FIGURES/evreq.tex
new file mode 100755
index 0000000..cb7921d
--- /dev/null
+++ b/comm/FIGURES/evreq.tex
@@ -0,0 +1,23 @@
+\setlength{\unitlength}{0.11mm}
+\begin{picture}(1080,488)(-500,340)
+\put(-320,500){\line(1,0){40}}
+\put(-260,600){\small\sf CLIENT}
+\put(280,600){\small\sf SERVICE}
+\put(-380,700){\small\sf SERVER}
+\put(-280,560){\framebox(180,100){}}
+\put(-400,680){\framebox(200,80){}}
+\put(260,580){\framebox(200,80){}}
+\put(-250,620){\oval(420,360)}
+\put(390,570){\oval(340,260)}
+\put(-100,600){\thicklines\vector(1,0){360}}
+\put(260,640){\thicklines\vector(-1,0){360}}
+\put(20,660){\small requests}
+\put(-20,560){\small events, errors}
+\put(-320,680){\line(0,-1){220}}
+\put(-320,620){\line(1,0){40}}
+\put(320,500){\small\sf EVQUEUE}
+\put(300,480){\framebox(220,60){}}
+\put(320,580){\thicklines\vector(0,-1){40}}
+\put(-320,380){\small server}
+\put(340,380){\small client}
+\end{picture}
diff --git a/comm/FIGURES/socketclasses.tex b/comm/FIGURES/socketclasses.tex
new file mode 100755
index 0000000..f592a0a
--- /dev/null
+++ b/comm/FIGURES/socketclasses.tex
@@ -0,0 +1,14 @@
+\setlength{\unitlength}{0.11mm}
+\begin{picture}(500,340)(-360,460)
+\put(-220,580){\line(0,-1){40}}
+\put(-180,740){\small\sf CHANNEL}
+\put(-180,660){\small\sf SOCKET}
+\put(-320,580){\small\sf DATAGRAM}
+\put(-280,500){\small\sf DGRAM}
+\put(-60,580){\small\sf STREAM}
+\put(-80,500){\small\sf MSTREAM}
+\put(-100,740){\line(0,-1){40}}
+\put(-100,660){\line(-2,-1){80}}
+\put(-100,660){\line(2,-1){80}}
+\put(20,580){\line(0,-1){40}}
+\end{picture}
diff --git a/comm/essai b/comm/essai
deleted file mode 100755
index afafb7f..0000000
--- a/comm/essai
+++ /dev/null
@@ -1,13 +0,0 @@
-client toto;
-
-request CreateStageReq {
- long StageID -> lword;
- const char* L -> CcuString;
- int T -> lword;
- int R -> lword;
- int B -> lword;
- CreateStageReq (StageID, L, T, R, B);
- getters (L, T);
- setters (L, T);
-};
-
diff --git a/comm/test.cc b/comm/test.cc
deleted file mode 100644
index a6dfabf..0000000
--- a/comm/test.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-#include "uch.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define TESTMSG
-
-#ifdef TESTMSG
-class MyRemoteAgent : public UchRemoteAgent {
-public:
- MyRemoteAgent (UchAgent* a, UchChannel* ch) : UchRemoteAgent (a, ch) {}
- ~MyRemoteAgent () {}
-bool NewMessage (UchMsgBuffer&, bool);
-};
-
-class MyAgent : public UchAgent {
-public:
- MyAgent (UchAddress* a) : UchAgent (a) {}
- ~MyAgent () {}
-UchRemoteAgent* HandleNew (UchChannel* ch) { return new MyRemoteAgent (this, ch); }
-};
-
-class MyMsg : public UchMessage {
- CcuString S1;
- CcuString S2;
-
-public:
- MyMsg (const char* s1, const char* s2) : UchMessage (), S1 (s1), S2 (s2) {}
- MyMsg () : UchMessage (), S1 ("S1"), S2 ("S2") {}
- ~MyMsg () {}
- void ReadFrom (UchMsgBuffer&, lword);
- void WriteTo (UchMsgBuffer&);
- void Dump () { printf ("[%s] [%s]\n", (const char*) S1, (const char*) S2); }
-};
-
-bool
-MyRemoteAgent :: NewMessage (UchMsgBuffer& b, bool)
-{
- MyMsg m;
- b.Get (m);
- m.Dump ();
- return true;
-}
-
-void
-MyMsg :: WriteTo (UchMsgBuffer& b)
-{
- b << S1 << S2;
-}
-
-void
-MyMsg :: ReadFrom (UchMsgBuffer& b, lword len)
-{
- b >> S1 >> S2;
-}
-
-#endif
-
-UchAgent* A;
-UchPortServer* 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 ()
- ? LOOPBACK : host, port);
- UchRemoteAgent* ra = A->Contact (addr);
- if (ra) {
- printf ("joined\n");
-#ifdef TESTMSG
- MyMsg m ("hello", "world");
- ra->Send (m);
-#endif
- } else {
- printf ("connection failed\n");
- delete addr;
- }
- return 1;
-}
-
-void
-fQuit (int, int)
-{
- printf ("quit\n");
- PS->Remove (BUF, *(UchInetAddress*) A->BoundTo ());
- exit (0);
-}
-
-void
-fTick (Millisecond t)
-{
- printf ("%d\n", t);
-}
-
-main (int argc, char** argv)
-{
- const char* id = argc > 1 ? argv [1] : "";
- UchInetAddress addr (ANYADDR);
-#ifdef TESTMSG
- MyAgent a (&addr);
-#else
- UchAgent a (&addr);
-#endif
- if (a.Setup ()) {
- A = &a;
- UchPortServer ps ("portserv");
- PS = &ps;
- ps.Match ("portserv:chatty", fMatch);
- char buf [64];
- strcpy (buf, "%s:%u:test");
- 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);
- a.Run ();
- ps.Remove (buf, *(UchInetAddress*) a.BoundTo ());
- }
-}