artdaq
v3_01_00
|
TransferInterface implementation plugin that sends data using TCP sockets. More...
#include <artdaq/TransferPlugins/TCPSocketTransfer.hh>
Public Member Functions | |
TCPSocketTransfer (fhicl::ParameterSet const &ps, Role role) | |
TCPSocketTransfer Constructor. More... | |
int | receiveFragmentHeader (detail::RawFragmentHeader &header, size_t receiveTimeout) override |
Receive a Fragment Header from the transport mechanism. More... | |
int | receiveFragmentData (RawDataType *destination, size_t wordCount) override |
Receive the body of a Fragment to the given destination pointer. More... | |
CopyStatus | copyFragment (Fragment &frag, size_t timeout_usec) override |
Copy a Fragment to the destination. Same implementation as moveFragment, as TCP is always reliable. More... | |
CopyStatus | moveFragment (Fragment &&frag) override |
Move a Fragment to the destination. More... | |
![]() | |
TransferInterface (const fhicl::ParameterSet &ps, Role role) | |
TransferInterface Constructor. More... | |
TransferInterface (const TransferInterface &)=delete | |
Copy Constructor is deleted. | |
TransferInterface & | operator= (const TransferInterface &)=delete |
Copy Assignment operator is deleted. More... | |
virtual | ~TransferInterface ()=default |
Default virtual Destructor. | |
virtual int | receiveFragment (artdaq::Fragment &fragment, size_t receiveTimeout) |
Receive a Fragment from the transport mechanism. More... | |
virtual CopyStatus | copyFragment (artdaq::Fragment &fragment, size_t send_timeout_usec)=0 |
Copy a Fragment to the destination. May not necessarily be reliable. More... | |
virtual CopyStatus | moveFragment (artdaq::Fragment &&fragment)=0 |
Move a Fragment to the destination. This should be reliable, if the underlying transport mechanism supports reliable sending. More... | |
std::string | uniqueLabel () const |
Get the unique label of this TransferInterface instance. More... | |
virtual int | source_rank () const |
Get the source rank for this TransferInterface instance. More... | |
virtual int | destination_rank () const |
Get the destination rank for this TransferInterface instance. More... | |
std::string | GetTraceName () const |
Constructs a name suitable for TRACE messages. More... | |
Additional Inherited Members | |
![]() | |
enum | : int { DATA_END = -2222, RECV_TIMEOUT = -1111, RECV_SUCCESS = 0 } |
enum | Role { Role::kSend, Role::kReceive } |
Used to determine if a TransferInterface is a Sender or Receiver. More... | |
enum | CopyStatus { CopyStatus::kSuccess, CopyStatus::kTimeout, CopyStatus::kErrorNotRequiringException } |
Returned from the send functions, this enumeration describes the possible return codes. If an exception occurs, it will be thrown and should be handled normally. More... | |
![]() | |
static std::string | CopyStatusToString (CopyStatus in) |
![]() | |
Role | role () const |
Get the TransferInterface::Role of this TransferInterface. More... | |
![]() | |
size_t | buffer_count_ |
The number of Fragment transfers the TransferInterface can handle simultaneously. | |
const size_t | max_fragment_size_words_ |
The maximum size of the transferred Fragment objects, in artdaq::Fragment::RawDataType words. | |
const short | partition_number_ |
The partition number of the DAQ. | |
TransferInterface implementation plugin that sends data using TCP sockets.
Definition at line 36 of file TCPSocketTransfer.hh.
artdaq::TCPSocketTransfer::TCPSocketTransfer | ( | fhicl::ParameterSet const & | ps, |
TransferInterface::Role | role | ||
) |
TCPSocketTransfer Constructor.
ps | ParameterSet used to configure TCPSocketTransfer |
role | Role of this TCPSocketTransfer instance (kSend or kReceive) |
* TCPSocketTransfer accepts the following Parameters: * "tcp_receive_buffer_size" (Default: 0): The TCP buffer size on the receive socket * "send_retry_timeout_us" (Default: 1000000): Microseconds between send retries (infinite retries for moveFragment, up to send_timeout_us for copyFragment) * "host_map" (REQUIRED): List of FHiCL tables containing information about other hosts in the system. * Each table should contain: * "rank" (Default: RECV_TIMEOUT): Rank of this host * "host" (Default: "localhost"): Hostname of this host * "portOffset" (Default: 5500): To avoid collisions, each destination should specify its own port offset. * All TCPSocketTransfers sending to that destination will add their own rank to make a unique port number. *
TCPSocketTransfer also requires all Parameters for configuring a TransferInterface
Definition at line 40 of file TCPSocket_transfer.cc.
|
inlineoverride |
Copy a Fragment to the destination. Same implementation as moveFragment, as TCP is always reliable.
frag | Fragment to copy |
timeout_usec | Timeout for send, in microseconds |
Definition at line 83 of file TCPSocketTransfer.hh.
|
inlineoverride |
Move a Fragment to the destination.
frag | Fragment to move |
Definition at line 90 of file TCPSocketTransfer.hh.
|
overridevirtual |
Receive the body of a Fragment to the given destination pointer.
destination | Pointer to memory region where Fragment data should be stored |
wordCount | Number of RawDataType words to receive |
Implements artdaq::TransferInterface.
Definition at line 307 of file TCPSocket_transfer.cc.
|
overridevirtual |
Receive a Fragment Header from the transport mechanism.
[out] | header | Received Fragment Header |
receiveTimeout | Timeout for receive |
Implements artdaq::TransferInterface.
Definition at line 118 of file TCPSocket_transfer.cc.