summaryrefslogtreecommitdiff
path: root/comm/OLD/TextServer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'comm/OLD/TextServer.cc')
-rw-r--r--comm/OLD/TextServer.cc32
1 files changed, 19 insertions, 13 deletions
diff --git a/comm/OLD/TextServer.cc b/comm/OLD/TextServer.cc
index 4b9ac14..5808fba 100644
--- a/comm/OLD/TextServer.cc
+++ b/comm/OLD/TextServer.cc
@@ -19,6 +19,12 @@
#include "PortServer.h"
#include <stdio.h>
+#ifdef __osf__
+extern "C" {
+ int accept (int, struct sockaddr*, int*);
+}
+#endif
+
/* every REG_TIME milliseconds, the server registers to the port server
we want this time to be shorter than the REG_TIME of the port server.
half the value of the port server's REG_TIME seems reasonable */
@@ -64,9 +70,9 @@ if \typ{MY_CLIENT} is the derived class of \var{UchTextClient} defined
by the application and \var{s} is this server.
?*/
UchTextServer :: UchTextServer (const char* serv, fNEW_CLIENT newcl)
-: UchStream (new UchInetAddress (ANYADDR), 0),
+: UchStream (new UchInetAddress (ANYADDR, 0), 0),
Timer (0),
- ok (FALSE),
+ ok (false),
Clients ()
{
service = serv;
@@ -93,15 +99,15 @@ UchTextServer :: Init (UchBaseMultiplexer& mpx)
{
if (Listen () < 0) { // calls Setup
SysError (ErrWarn, "UchTextServer::Setup");
- return FALSE;
+ return false;
}
mpx.Add (*this);
- ok = TRUE;
+ ok = true;
char buf [128];
sprintf (buf, "listening on port #%d", (void*) ((UchInetAddress*) BoundTo ())->Port ());
- Error (ErrLog, "UchTextServer::Init", buf);
+ ::Error (ErrLog, "UchTextServer::Init", buf);
Timer = new UchTextServerTimer (this);
- return TRUE;
+ return true;
}
/*?
@@ -117,7 +123,7 @@ UchTextServer :: Quit ()
{
if (! ok)
return;
- ok = FALSE;
+ ok = false;
// a bit tricky because of the smart pointers:
// each tstream probably is referenced only through the multiplexer
// removing it from the multiplexer hence deletes it.
@@ -156,7 +162,7 @@ UchTextServer :: Remove (UchTextClient* s)
int found = Clients.Remove (s);
if (!found)
- Error (ErrWarn, "UchTextServer::Remove", "stream not in client list");
+ ::Error (ErrWarn, "UchTextServer::Remove", "stream not in client list");
if (Mpx)
Mpx->Remove (*s);
@@ -220,7 +226,7 @@ UchTextClient :: UchTextClient (UchTextServer* s)
: UchTextStream (),
MyServer (s)
{
- sendToOut = FALSE;
+ sendToOut = false;
out = 0;
}
@@ -247,8 +253,8 @@ UchTextClient :: Starting ()
/*?
This protected virtual function is called by \fun{HandleRead} when
-an end-of-file is read (the argument is then TRUE) or when an error occured
-while reading (the argument is then FALSE).
+an end-of-file is read (the argument is then true) or when an error occured
+while reading (the argument is then false).
It calls the server's \fun{Remove} function for this client,
which should result in the destruction of the client.
This virtual function can be redefined in derived classes, but the
@@ -321,7 +327,7 @@ If \var{ch} is 0, output is simply discarded.
void
UchTextClient :: SetOutput (UchChannel* ch)
{
- sendToOut = TRUE;
+ sendToOut = true;
out = ch;
}
@@ -332,6 +338,6 @@ void
UchTextClient :: ResetOutput ()
{
out = 0;
- sendToOut = FALSE;
+ sendToOut = false;
}