From f94a933e3eecbe4fde14183117fbc056418eeb23 Mon Sep 17 00:00:00 2001 From: chatty Date: Mon, 26 Jul 1993 16:28:06 +0000 Subject: Now handle CPLUS_BUG19 --- comm/OLD/Server.cc | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'comm/OLD/Server.cc') 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 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 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 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 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: -- cgit v1.1