17 #ifndef HADAQ_UDPTRANSPORT_H
18 #define HADAQ_UDPTRANSPORT_H
20 #ifndef DABC_SocketThread
28 #ifndef DABC_DataTransport
32 #ifndef HADAQ_HadaqTypeDefs
117 virtual long Notify(
const std::string&,
int);
125 NewAddon(
int fd,
int nport,
int mtu,
bool debug,
int maxloop,
double reduce,
double lost);
130 static int OpenUdp(
const std::string &host,
int nport,
int rcvbuflen);
Represents command with its arguments.
Manipulator with dabc::Buffer class.
Reference on the dabc::Port class
Special addon class for handling of socket and socket events.
Base class for transport implementations.
dabc::TimeStamp fLastProcTm
last time when udp reading was performed
int fSendCnt
counter of send buffers since last timeout active
int fSkipCnt
counter used to control buffers skipping
int fLostCnt
counter used to drop buffers
double fMaxProcDist
maximal time between calls to BuildEvent method
NewAddon(int fd, int nport, int mtu, bool debug, int maxloop, double reduce, double lost)
unsigned fMTU
maximal size of packet expected from TRB
virtual long Notify(const std::string &, int)
Light-weight command interface.
void * fMtuBuffer
buffer used to skip packets when no normal buffer is available
int fMaxLoopCnt
maximal number of UDP packets, read at once
double fReduce
reduce filled buffer size to let reformat data later
bool fDebug
when true, produce more debug output
static int OpenUdp(const std::string &host, int nport, int rcvbuflen)
virtual void ProcessEvent(const dabc::EventId &)
double fLostRate
artificial lost of received UDP packets
dabc::Pointer fTgtPtr
pointer used to read data
bool fRunning
is transport running
int fLastSendCnt
used for flushing
bool fBufAssigned
if next buffer assigned
bool AssignNewBuffer(unsigned pool, NewAddon *addon=nullptr)
virtual bool ProcessBuffer(unsigned pool)
Method called by framework when at least one buffer available in pool handle.
void FlushBuffer(bool onclose=false)
virtual bool StartTransport()
Methods activated by Port, when transport starts/stops.
dabc::TimeStamp fLastDebugTm
timer used to generate rare debugs output
virtual bool ProcessSend(unsigned port)
Method called by framework when at least one buffer can be send to output port.
virtual void ProcessTimerEvent(unsigned timer)
Method called by framework when timer event is produced.
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
unsigned fNumReadyBufs
number of filled buffers which could be posted
NewTransport(dabc::Command, const dabc::PortRef &inpport, NewAddon *addon, double flush=1, double heartbeat=-1)
int fIdNumber
input port item id
virtual bool StopTransport()
Terminal for HADAQ event builder.
std::string number_to_str(unsigned long num, int prec=1, int select=0)
Convert number to string of form like 4.2G or 3.7M.
Support for HADAQ - HADES DAQ
Event structure, exchanged between DABC threads.
Class for acquiring and holding timestamps.
int fNPort
upd port number
uint64_t fTotalDiscardPacket
uint64_t fTotalRecvPacket
uint64_t fTotalArtificialSkip
uint64_t fTotalProducedBuffers
uint64_t fTotalDiscard32Packet
std::string GetDiscard32String()
uint64_t fTotalArtificialLosts
std::string GetDiscardString()
uint64_t fTotalDiscardBytes