15 #include "networkmod.h" 26 #define mReturn( ret ) { \ 27 if ( ret ) { nrattempts_ = 0; return true; } \ 28 if ( nrattempts_++ < maxtries_ ) return true; \ 30 directMsg("Lost connection with master[1]. Exiting."); \ 31 ExitProgram( -1 ); return false; \ 34 #define mTryMaxtries( fn ) { \ 35 for ( int i=0; i<maxtries_; i++ ) \ 38 if ( ret ) return true; \ 42 directMsg("Lost connection with master[2]. Exiting."); \ 43 ExitProgram( -1 ); return false; \ 55 JobError, HostError, Killed, Timeout };
61 bool ok() {
return stillok_; }
69 bool ret = sendState_(stat_,
false,
false);
73 {
bool ret = sendProgress_(p,
false);
mReturn(ret) }
75 void setTimeBetweenMsgUpdates(
int);
105 bool sendState_(
State,
bool isexit,
bool immediate );
106 bool sendProgress_(
int,
bool immediate );
107 bool sendPID_(
int );
108 bool sendErrMsg_(
const char* msg );
110 void alarmHndl( CallBacker* );
113 bool updateMsg(
char tag,
int,
const char* msg=0 );
114 bool sendMsg(
char tag,
int,
const char* msg=0 );
115 BufferString buildString(
char tag,
int,
const char* msg=0 );
118 void directMsg(
const char* msg );
120 void setErrMsg(
const char*);
122 void checkMasterTimeout();
134 void logMsg(
bool stat,
const char* msg,
const char* details);
137 void dumpSystemInfo();
#define mExpClass(module)
Definition: commondefs.h:160
#define mReturn(ret)
Definition: jobcommunic.h:26
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
int socktimeout_
Definition: jobcommunic.h:127
bool sendState(bool isexit=false)
Definition: jobcommunic.h:77
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
bool stillok_
Definition: jobcommunic.h:96
FixedString Undef()
Definition: keystrs.h:142
Definition: jobcommunic.h:24
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
State stat_
Definition: jobcommunic.h:97
int failtimeout_
Definition: jobcommunic.h:128
void setState(State s)
Definition: jobcommunic.h:65
bool sendPID(int pid)
Definition: jobcommunic.h:85
int timestamp_
Definition: jobcommunic.h:124
Definition: uistring.h:89
int nrattempts_
Definition: jobcommunic.h:125
od_ostream * logstream_
Definition: jobcommunic.h:135
int min_time_between_update_
Definition: jobcommunic.h:129
int maxtries_
Definition: jobcommunic.h:126
bool updateProgress(int p)
Definition: jobcommunic.h:72
int lastsucces_
Definition: jobcommunic.h:130
uiString errmsg_
Definition: jobcommunic.h:98
Holds data to use and close an iostream.
Definition: strmdata.h:28
#define mTryMaxtries(fn)
Definition: jobcommunic.h:34
int lastupdate_
Definition: jobcommunic.h:132
int min_time_between_msgupdates_
Definition: jobcommunic.h:131
Main object for 'standard' batch programs.
Definition: batchprog.h:49
bool ok()
Definition: jobcommunic.h:61
State
Definition: jobcommunic.h:54
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString errmsg_
Definition: horizontracker.h:119
int masterport_
Definition: jobcommunic.h:95
bool updateState()
Definition: jobcommunic.h:67
BufferString masterhost_
Definition: jobcommunic.h:94
int jobid_
Definition: jobcommunic.h:99
uiString errMsg()
Definition: jobcommunic.h:62
State state() const
Definition: jobcommunic.h:64
bool sendProgress(int p)
Definition: jobcommunic.h:79
Multi-machine socket communicator Handles the communication between a client and the master...
Definition: jobcommunic.h:51
bool sendErrMsg(const char *msg)
hostrelated error messages are more serious.
Definition: jobcommunic.h:83
Definition: jobcommunic.h:54
Network::Socket * socket_
Definition: jobcommunic.h:103
bool pausereq_
Definition: jobcommunic.h:100
StreamData & sdout_
Definition: jobcommunic.h:101
bool pauseRequested() const
Definition: jobcommunic.h:88