summaryrefslogtreecommitdiff
path: root/comm
diff options
context:
space:
mode:
authorchatty1993-08-17 16:11:52 +0000
committerchatty1993-08-17 16:11:52 +0000
commitda823819c7cdb88bd1d3a94d705b1f4371b5469d (patch)
treee330b327aee64d0c193cde550e1fd1f8afb10085 /comm
parent113ee0c47cf0a7ba98ba2cbbea549d15deb125f7 (diff)
downloadivy-league-da823819c7cdb88bd1d3a94d705b1f4371b5469d.zip
ivy-league-da823819c7cdb88bd1d3a94d705b1f4371b5469d.tar.gz
ivy-league-da823819c7cdb88bd1d3a94d705b1f4371b5469d.tar.bz2
ivy-league-da823819c7cdb88bd1d3a94d705b1f4371b5469d.tar.xz
Added Multiplexer arg to constr and Init of TextService,
to allow automatic adding to the multiplexer in Restart
Diffstat (limited to 'comm')
-rw-r--r--comm/OLD/TextStream.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/comm/OLD/TextStream.cc b/comm/OLD/TextStream.cc
index a869b9e..117c3ae 100644
--- a/comm/OLD/TextStream.cc
+++ b/comm/OLD/TextStream.cc
@@ -729,7 +729,7 @@ UchTextService :: UchTextService ()
Construct a \var{UchTextService} connected to server \var{s} on host \var{h}.
This is equivalent to the empty constructor followed by a call to \fun{Init}.
?*/
-UchTextService :: UchTextService (const char* s, const char* h)
+UchTextService :: UchTextService (UchBaseMultiplexer& mpx, const char* s, const char* h)
: UchTextStream (),
StatusFlag (isLost),
Starter (0),
@@ -738,7 +738,7 @@ UchTextService :: UchTextService (const char* s, const char* h)
Service (),
Host ()
{
- Init (s, h);
+ Init (mpx, s, h);
}
/*?
@@ -776,8 +776,7 @@ to that address.
If this fails, it sets the state to \var{isError} and returns.
Otherwise, it sets the state to \var{isRunning} and calls the virtual
function \fun{GotServer}.
-The service is automatically registered with the multiplexer
-(by calling \fun{MpxAddChannel} with mode \var{IONone})
+The service is automatically registered with the multiplexer, with mode \var{IONone}
the first time the connection is established.
?*/
UchTextService::status
@@ -826,7 +825,8 @@ UchTextService :: Restart ()
setup = Setup ();
if (! wasopened) {
SetMode (IONone);
- Mpx->Add (this);
+ if (Mpx)
+ Mpx->Add (this); ///////// Mpx was initialized by Init
}
if (! setup) {
fprintf (stderr, "UchTextService::Restart, could not setup connection\n");
@@ -962,14 +962,15 @@ If the connection to the server cannot be established, \fun{Init} calls
\var{AutoStart} to attempt the connection later.
?*/
void
-UchTextService :: Init (const char* s, const char* h)
+UchTextService :: Init (UchBaseMultiplexer& mpx, const char* s, const char* h)
{
if (StatusFlag == isRunning)
return;
Service = s;
Host = h;
-
+ Mpx = &mpx;
+
StatusFlag = Restart ();
if (StatusFlag == isError) {
// try to run the agent manager
@@ -1031,6 +1032,7 @@ UchTextService :: CloseNow ()
Mpx->Remove (*this);
}
+#if 0
/*?
This global function provides the simplest interface to send a request \var{req}
to a server \var{sname} on host \var{host}.
@@ -1044,3 +1046,4 @@ TellServer (const char* sname, const char* host, const char* req)
serv->Close ();
return TRUE;
}
+#endif