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