Class SendSocketBuffered

Inheritance Relationships

Base Type

Class Documentation

class SendSocketBuffered : public netio3::libfabric::SendSocket

Represents a send socket for buffered data transmission.

This class extends the SendSocket class and provides functionality for sending data over the network using a set of buffers. The number of size and buffers are configured through the connection parameters. Buffers can be requested using the get_buffer function and sent using the send_buffer function.

The key that is returned to the user on the on_send_complete callback corresponds to the ID of the buffer.

Public Functions

SendSocketBuffered(EndPointAddress address, const ConnectionParameters &connection_params, NetworkMode mode, fid_fabric *fabric, DomainContext &domain)

Constructs a SendSocketBuffered object.

The constructor calls the constructor of the base class creating the endpoint. It then allocates and registers the send buffers as memory regions.

Parameters:
  • address – The endpoint address to which the socket will send data

  • connection_params – The connection parameters used to configure the buffers

  • mode – The network mode to be used for communication (TCP or RDMA)

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

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

SendSocketBuffered(const SendSocketBuffered&) = delete
SendSocketBuffered(SendSocketBuffered&&) = delete
SendSocketBuffered &operator=(const SendSocketBuffered&) = delete
SendSocketBuffered &operator=(SendSocketBuffered&&) = delete
~SendSocketBuffered()

Destroys the SendSocketBuffered object.

Unregister the buffers.

inline auto operator<=>(const SendSocketBuffered &other) const
inline NetworkBuffer *get_buffer()

Retrieves a network buffer.

If no buffers are available, returns nullptr.

@important Check that returned buffer is not null.

Throws:

NoBuffersAllocated – if no buffers were allocated

Returns:

A pointer to the network buffer (or null of none available)

inline NetioStatus send_buffer(Buffer *buffer, std::size_t size) const

Sends the provided buffer

Buffer needs to be a registered memory region that was obtained from get_buffer. The return value indicates whether the send operation was successful. The maximum of concurrent send operations is defined by the number of allocated buffers.

Parameters:
  • buffer – The buffer to send

  • size – The size of the buffer

Returns:

The status of the send operation

inline std::uint64_t release_buffer(std::uint64_t bufnum)

Marks the buffer with the specified buffer number as available for reuse.

Parameters:

bufnum – The buffer number to release

Returns:

The key (is equal to buffer number for buffered sending)

std::size_t get_num_available_buffers()

Retrieves the number of available buffers.

Returns the mininum number of available buffers since the last call to this function.

Returns:

The number of available buffers

inline std::vector<std::uint64_t> get_pending_sends() const

Returns an empty vector (only needed for zero-copy sending)

Returns:

Empty vector