68 Error(
"TMPWorker::Run",
"Lost connection to client\n");
90 unsigned code = msg.first;
92 std::string reply =
fId;
106 reply +=
": unknown code received. code=" + std::to_string(code);
116 std::string reply =
fId +
": " + errmsg;
std::pair< unsigned, std::unique_ptr< TBufferFile > > MPCodeBufPair
An std::pair that wraps the code and optional object contained in a message.
MPCodeBufPair MPRecv(TSocket *s)
Receive message from a socket.
int MPSend(TSocket *s, unsigned code)
Send a message with the specified code on the specified socket.
void Error(const char *location, const char *msgfmt,...)
R__EXTERN TSystem * gSystem
void SendError(const std::string &errmsg, unsigned int code=MPCode::kError)
Error sender.
unsigned GetNWorker() const
std::string fId
identifier string in the form W<nwrk>|P<proc id>
unsigned fNWorker
the ordinal number of this worker (0 to nWorkers-1)
virtual void HandleInput(MPCodeBufPair &msg)
Handle a message with an EMPCode.
pid_t fPid
the PID of the process in which this worker is running
std::unique_ptr< TSocket > fS
This worker's socket. The unique_ptr makes sure resources are released.
virtual void Init(int fd, unsigned workerN)
This method is called by children processes right after forking.
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
@ kMessage
Generic message.
@ kRecvError
Error while reading from the socket.
@ kFatalError
Fatal error: whoever sends this message is terminating execution.
@ kShutdownOrder
Used by the client to tell servers to shutdown.
@ kShutdownNotice
Used by the workers to notify client of shutdown.