Class ReceiveSocket

Inheritance Relationships

Base Type

Class Documentation

class ReceiveSocket : public netio3::libfabric::BaseSocket

Represents a receive socket for receiving data using libfabric.

Provides functionality to receive data over the network. It posts a number of receive buffers to libfabric. The event queue and completion queue callbacks are set through the base class. They call the on_recv_socket_cm_event of the ConnectionManager and the on_recv_socket_cq_event of the CqReactor.

Public Functions

ReceiveSocket(ListenSocket &lsocket, fid_fabric *fabric, DomainContext &domain, FiInfoUniquePtr &&info, BaseEventLoop *event_loop)

Constructs a ReceiveSocket object.

The constructor creates the endpoint and accepts the connection. If accepting the connection fails, it calls reject on the listen socket and throws an exception. In the success case, it takes the connection parameters from the listen socket and creates and posts the receive buffers.

Throws:

FailedOpenReceiveEndpoint – in case of a libfabric error

Parameters:
  • lsocket – The listen socket spawning the receive socket

  • fabric – The network fabric (used to create endpoint)

  • domain – The listen domain (used to create endpoint)

  • info – The network info

  • event_loop – The event loop

ReceiveSocket(const ReceiveSocket&) = delete
ReceiveSocket(ReceiveSocket&&) = default
ReceiveSocket &operator=(const ReceiveSocket&) = delete
ReceiveSocket &operator=(ReceiveSocket&&) = default
~ReceiveSocket()

Closes the receive socket.

inline auto operator<=>(const ReceiveSocket &other) const
void post_buffers()

Posts all buffers for receiving data.

See post_buffer for more information.

void post_buffer(Buffer *buf)

Posts a buffer for receiving data.

Is called after a received data have been processed and the buffer is ready to be used again.

Parameters:

buf – A pointer to the buffer to be posted