Loading...
Searching...
No Matches
ucxx::Listener Class Reference

Component encapsulating a UCP listener. More...

#include <listener.h>

Inheritance diagram for ucxx::Listener:
ucxx::Component

Public Member Functions

 Listener (const Listener &)=delete
Listener & operator= (Listener const &)=delete
 Listener (Listener &&o)=delete
Listener & operator= (Listener &&o)=delete
EndpointBuilder endpointBuilder (ucp_conn_request_h connRequest)
 Create a builder for an endpoint from a connection request.
ucp_listener_h getHandle ()
 Get the underlying ucp_listener_h handle.
uint16_t getPort ()
 Get the port to which the listener is bound to.
std::string getIp ()
 Get the IP address to which the listener is bound to.
Public Member Functions inherited from ucxx::Component
void setParent (std::shared_ptr< Component > parent)
 Set the internal parent reference.
std::shared_ptr< Component > getParent () const
 Get the internal parent reference.

Friends

class detail::ConstructorFactory

Additional Inherited Members

Protected Attributes inherited from ucxx::Component
std::shared_ptr< Component > _parent {nullptr}
 A reference-counted pointer to the parent.

Detailed Description

Component encapsulating a UCP listener.

The UCP layer provides a handle to access listeners in form of ucp_listener_h object, this class encapsulates that object and provides methods to simplify its handling.

Member Function Documentation

◆ endpointBuilder()

EndpointBuilder ucxx::Listener::endpointBuilder ( ucp_conn_request_h connRequest)
nodiscard

Create a builder for an endpoint from a connection request.

Calling this method only creates the builder. Finalizing it with .build() or implicit conversion creates the endpoint from this listener.

Parameters
[in]connRequesthandle to connection request delivered by a listener callback.
Returns
Builder to configure optional endpoint parameters.

◆ getHandle()

ucp_listener_h ucxx::Listener::getHandle ( )
nodiscard

Get the underlying ucp_listener_h handle.

Lifetime of the ucp_listener_h handle is managed by the ucxx::Listener object and its ownership is non-transferrable. Once the ucxx::Listener is destroyed the handle is not valid anymore, it is the user's responsibility to ensure the owner's lifetime while using the handle.

// listener is `std::shared_ptr<ucxx::Listener>`
ucp_listener_h listenerHandle = listener->getHandle();
Returns
The underlying ucp_listener_h handle.

◆ getIp()

std::string ucxx::Listener::getIp ( )
nodiscard

Get the IP address to which the listener is bound to.

Get the IP address to which the listener is bound to.

Returns
the IP address to which the listener is bound to.

◆ getPort()

uint16_t ucxx::Listener::getPort ( )
nodiscard

Get the port to which the listener is bound to.

Get the port to which the listener is bound to.

Returns
the port to which the listener is bound to.

The documentation for this class was generated from the following file: