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. | |
int | receiveFragmentHeader (detail::RawFragmentHeader &header, size_t receiveTimeout) override |
Receive a Fragment Header from the transport mechanism. | |
int | receiveFragmentData (RawDataType *destination, size_t wordCount) override |
Receive the body of a Fragment to the given destination pointer. | |
CopyStatus | copyFragment (Fragment &frag, size_t timeout_usec) override |
Copy a Fragment to the destination. Same implementation as moveFragment, as TCP is always reliable. | |
CopyStatus | moveFragment (Fragment &&frag) override |
Move a Fragment to the destination. | |
bool | isRunning () override |
Determine whether the TransferInterface plugin is able to send/receive data. |
TransferInterface implementation plugin that sends data using TCP sockets.
Definition at line 38 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 41 of file TCPSocket_transfer.cc.
CopyStatus artdaq::TCPSocketTransfer::copyFragment | ( | Fragment & | frag, | |
size_t | timeout_usec | |||
) | [inline, override] |
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 85 of file TCPSocketTransfer.hh.
bool artdaq::TCPSocketTransfer::isRunning | ( | ) | [override, virtual] |
Determine whether the TransferInterface plugin is able to send/receive data.
Reimplemented from artdaq::TransferInterface.
Definition at line 466 of file TCPSocket_transfer.cc.
CopyStatus artdaq::TCPSocketTransfer::moveFragment | ( | Fragment && | frag | ) | [inline, override] |
Move a Fragment to the destination.
frag | Fragment to move |
Definition at line 92 of file TCPSocketTransfer.hh.
int artdaq::TCPSocketTransfer::receiveFragmentData | ( | RawDataType * | destination, | |
size_t | wordCount | |||
) | [override, virtual] |
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 326 of file TCPSocket_transfer.cc.
int artdaq::TCPSocketTransfer::receiveFragmentHeader | ( | detail::RawFragmentHeader & | header, | |
size_t | receiveTimeout | |||
) | [override, virtual] |
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.