summaryrefslogtreecommitdiff
path: root/comm/OLD
diff options
context:
space:
mode:
authorchatty1993-07-26 16:28:06 +0000
committerchatty1993-07-26 16:28:06 +0000
commitf94a933e3eecbe4fde14183117fbc056418eeb23 (patch)
treed134b9452a6aa656a029bf6294cda7012c7cd014 /comm/OLD
parentf8fb87ef28da3e35e7bef998161fbda62b511d6d (diff)
downloadivy-league-f94a933e3eecbe4fde14183117fbc056418eeb23.zip
ivy-league-f94a933e3eecbe4fde14183117fbc056418eeb23.tar.gz
ivy-league-f94a933e3eecbe4fde14183117fbc056418eeb23.tar.bz2
ivy-league-f94a933e3eecbe4fde14183117fbc056418eeb23.tar.xz
Now handle CPLUS_BUG19
Diffstat (limited to 'comm/OLD')
-rw-r--r--comm/OLD/Server.cc36
-rw-r--r--comm/OLD/Server.h6
2 files changed, 39 insertions, 3 deletions
diff --git a/comm/OLD/Server.cc b/comm/OLD/Server.cc
index a2e908b..e10b278 100644
--- a/comm/OLD/Server.cc
+++ b/comm/OLD/Server.cc
@@ -239,14 +239,16 @@ and then run it.
If you have added your own channels to the channel set of the server,
their \fun{HandleRead} and \fun{HandleWrite} functions will be called normally by \fun{Run}.
?*/
-void
+MPX_RES
UchServer :: Run ()
{
if (! ChanSet)
if (! Setup ())
Error (ErrFatal, "UchServer::Run", "could not setup");
if (ChanSet)
- ChanSet->LoopScan ();
+ return ChanSet->LoopScan ();
+ else
+ return isMpxError;
}
/*?
@@ -256,9 +258,15 @@ If \var{flush} is TRUE, the output buffer of each client is flushed.
void
UchServer :: Broadcast (UchMessage& msg, bool flush)
{
+#ifndef CPLUS_BUG19
CcuListIterOf <UchClient> li (Clients);
while (++li)
(*li)->Send (msg, flush);
+#else
+ CcuListIter li (Clients);
+ while (++li)
+ ((UchClient*)(*li))->Send (msg, flush);
+#endif
}
/*?
@@ -268,19 +276,34 @@ If \var{flush} is TRUE, the output buffer of each client is flushed.
void
UchServer :: Broadcast (UchMessage& msg, UchClient* excl, bool flush)
{
+#ifndef CPLUS_BUG19
CcuListIterOf <UchClient> li (Clients);
while (++li)
if (*li != excl)
(*li)->Send (msg, flush);
+#else
+ CcuListIter li (Clients);
+ while (++li) {
+ UchClient* a = (UchClient*)(*li);
+ if (a != excl)
+ a->Send (msg, flush);
+ }
+#endif
}
/*?nextdoc?*/
void
UchServer :: Broadcast (UchMsgBuffer& buf, bool flush)
{
+#ifndef CPLUS_BUG19
CcuListIterOf <UchClient> li (Clients);
while (++li)
(*li)->Send (buf, flush);
+#else
+ CcuListIter li (Clients);
+ while (++li)
+ ((UchClient*)(*li))->Send (buf, flush);
+#endif
}
/*?
@@ -292,10 +315,19 @@ message conversion overhead.
void
UchServer :: Broadcast (UchMsgBuffer& buf, UchClient* excl, bool flush)
{
+#ifndef CPLUS_BUG19
CcuListIterOf <UchClient> li (Clients);
while (++li)
if (*li != excl)
(*li)->Send (buf, flush);
+#else
+ CcuListIter li (Clients);
+ while (++li) {
+ UchClient* a = (UchClient*)(*li);
+ if (a != excl)
+ a->Send (buf, flush);
+ }
+#endif
}
// clients:
diff --git a/comm/OLD/Server.h b/comm/OLD/Server.h
index 7f8c597..71f24e2 100644
--- a/comm/OLD/Server.h
+++ b/comm/OLD/Server.h
@@ -45,7 +45,11 @@ class UchServer : public UchStream {
friend class UchClient;
protected:
+#ifndef CPLUS_BUG19
CcuListOf <UchClient> Clients;
+#else
+ CcuList Clients;
+#endif
pUchMultiplexer ChanSet;
public:
@@ -60,7 +64,7 @@ public:
bool Setup (UchMultiplexer* cs = 0);
inline UchMultiplexer* GetMultiplexer () { return ChanSet; }
void RemoveClient (UchClient*);
- void Run ();
+ MPX_RES Run ();
void Unlisten ();
void Broadcast (UchMessage&, bool = FALSE);
void Broadcast (UchMessage&, UchClient*, bool = FALSE);