|
ATLAS Offline Software
|
Go to the documentation of this file.
18 base_class (
name, sl ),
22 declareProperty(
"Hostname",
m_hostName=
"localhost",
"The name of the host the external server is running on [ default: \"localhost\" ]");
23 declareProperty(
"Timeout",
m_timeOut=10,
"Timeout when calling the server in seconds [ default: 10 ]");
52 return StatusCode::SUCCESS;
74 return StatusCode::FAILURE;
79 # pragma GCC diagnostic push
80 # pragma GCC diagnostic ignored "-Wcast-function-type"
83 clnt_stat ret = clnt_call(
m_client, NULLPROC, (xdrproc_t)xdr_void, NULL,
86 # pragma GCC diagnostic pop
90 if (ret != RPC_SUCCESS){
96 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
110 struct timeval
timeout = { 0, 0 };
112 if (m_timeOut < 0)
return timeout;
114 timeout.tv_sec =
static_cast<long>(m_timeOut);
116 timeout.tv_usec =
static_cast<long>((m_timeOut -
timeout.tv_sec)*1e6);
130 return StatusCode::SUCCESS;
146 return StatusCode::SUCCESS;
159 ATH_MSG_ERROR(
"Invalid event stream identifier - cannot add event" );
160 return StatusCode::FAILURE;
166 event.isAvailable = false ;
event.isIdentical = false ;
event.isCompressed = false ;
167 event.RunNumber = evtStreamID.
RunNumber();
169 event.StreamName=strdup(evtStreamID.
StreamName().c_str());
170 event.NBytes = strlen(eventStr.c_str())+1;
171 event.EventData = strdup(eventStr.c_str());
174 <<
" from run " <<
event.RunNumber
175 <<
" to be put in stream " <<
event.StreamName
176 <<
" with " <<
event.NBytes <<
" bytes" );
183 <<
" from run " << evtStreamID.
RunNumber() );
184 return StatusCode::FAILURE;
188 bool isSuccess =
false;
190 (xdrproc_t)xdr_bool,(caddr_t)&isSuccess,
GetTimeout());
193 if (ret != RPC_SUCCESS){
197 <<
" from run " << evtStreamID.
RunNumber() );
198 return StatusCode::FAILURE;
206 <<
" from run " << evtStreamID.
RunNumber() );
207 return StatusCode::FAILURE;
214 <<
" from run " << evtStreamID.
RunNumber() );
219 return StatusCode::SUCCESS;
StatusCode GetClient()
Obtain a client handle by.
unsigned long EventNumber() const
#define ATH_MSG_VERBOSE(x)
ExternalONCRPCServerSvc(const std::string &name, ISvcLocator *sl)
Default constructor.
virtual StatusCode initialize() override
Gaudi default methods.
POOL::TEvent event(POOL::TEvent::kClassAccess)
::StatusCode StatusCode
StatusCode definition for legacy code.
bool_t xdr_event(XDR *xdrsp, Event *event)
De-/Encoding of Event_t.
This athena service will provide a link to an external ONCRPC server, e.g running as standalone appli...
struct timeval GetTimeout()
Convert timeout double in seconds to struct timeval.
For the client-server communication, each event is uniquely identified by the run number,...
const std::string & StreamName() const
virtual ~ExternalONCRPCServerSvc()
Destructor.
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
#define ONCRPC_SETEVENT_PROC
StatusCode ReleaseClient()
Destroy the private client handle.
virtual StatusCode UpdateEventForStream(const EventStreamID &evtStreamID, const std::string &event) override
Put this event as new current event for stream given by name.
virtual StatusCode finalize() override
Finalize - called once at the end.
#define ATH_MSG_WARNING(x)
unsigned int RunNumber() const