From c7096e6189ee7cec99ac3bb625c045f68c4f4b8c Mon Sep 17 00:00:00 2001 From: chatty Date: Mon, 29 Nov 1993 09:45:49 +0000 Subject: Made communications synchronous Now use HandleNew --- comm/OLD/Agent.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'comm/OLD/Agent.cc') diff --git a/comm/OLD/Agent.cc b/comm/OLD/Agent.cc index 6c06f01..ec4c28d 100644 --- a/comm/OLD/Agent.cc +++ b/comm/OLD/Agent.cc @@ -158,7 +158,7 @@ UchAgent :: HandleRead () SysError (ErrWarn, "UchAgent::HandleRead: Accept"); return; } - UchRemoteAgent* ra = new UchRemoteAgent (this, ch); + UchRemoteAgent* ra = HandleNew (ch); delete ch; ra->SetMode (IOReadSelect); @@ -170,9 +170,10 @@ UchAgent :: HandleRead () /*? This virtual function is called whenever a new agent connects to this one. ?*/ -void -UchAgent :: HandleNew (UchRemoteAgent*) +UchRemoteAgent* +UchAgent :: HandleNew (UchChannel* ch) { + return new UchRemoteAgent (this, ch); } /*? @@ -359,9 +360,12 @@ UchRemoteAgent :: UchRemoteAgent (UchAgent* a, UchChannel* ch) } UchRemoteAgent :: UchRemoteAgent (UchAgent* a, UchAddress* addr) -: UchMsgStream (addr, 0), +: UchMsgStream (0, addr), MyLocalAgent (a) { + if (!Setup ()) + SysError (ErrWarn, "Connect"); + SetSyncMode (TRUE); } -- cgit v1.1