Component encapsulating a UCP listener. More...
#include <listener.h>
Public Member Functions | |
| Listener (const Listener &)=delete | |
| Listener & | operator= (Listener const &)=delete |
| Listener (Listener &&o)=delete | |
| Listener & | operator= (Listener &&o)=delete |
| std::shared_ptr< Endpoint > | createEndpointFromConnRequest (ucp_conn_request_h connRequest, bool endpointErrorHandling=true) |
Constructor for shared_ptr<ucxx::Endpoint>. More... | |
| ucp_listener_h | getHandle () |
Get the underlying ucp_listener_h handle. More... | |
| uint16_t | getPort () |
| Get the port to which the listener is bound to. More... | |
| std::string | getIp () |
| Get the IP address to which the listener is bound to. More... | |
Public Member Functions inherited from ucxx::Component | |
| void | setParent (std::shared_ptr< Component > parent) |
| Set the internal parent reference. More... | |
| std::shared_ptr< Component > | getParent () const |
| Get the internal parent reference. More... | |
Friends | |
| std::shared_ptr< Listener > | createListener (std::shared_ptr< Worker > worker, uint16_t port, ucp_listener_conn_callback_t callback, void *callbackArgs) |
Constructor of shared_ptr<ucxx::Listener>. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ucxx::Component | |
| std::shared_ptr< Component > | _parent {nullptr} |
| A reference-counted pointer to the parent. | |
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.
| std::shared_ptr<Endpoint> ucxx::Listener::createEndpointFromConnRequest | ( | ucp_conn_request_h | connRequest, |
| bool | endpointErrorHandling = true |
||
| ) |
Constructor for shared_ptr<ucxx::Endpoint>.
The constructor for a shared_ptr<ucxx::Endpoint> object from a ucp_conn_request_h, as delivered by a ucxx::Listener connection callback.
| [in] | connRequest | handle to connection request delivered by a listener callback. |
| [in] | endpointErrorHandling | whether to enable endpoint error handling. |
shared_ptr<ucxx::Endpoint> object. | ucp_listener_h ucxx::Listener::getHandle | ( | ) |
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.
ucp_listener_h handle. | std::string ucxx::Listener::getIp | ( | ) |
Get the IP address to which the listener is bound to.
Get the IP address to which the listener is bound to.
| uint16_t ucxx::Listener::getPort | ( | ) |
Get the port to which the listener is bound to.
Get the port to which the listener is bound to.
|
friend |
Constructor of shared_ptr<ucxx::Listener>.
The constructor for a shared_ptr<ucxx::Listener> object. The default constructor is made private to ensure all UCXX objects are shared pointers for correct lifetime management.
| [in] | worker | the worker from which to create the listener. |
| [in] | port | the port which the listener should be bound to. |
| [in] | callback | user-defined callback to be executed on incoming client connections. |
| [in] | callbackArgs | argument to be passed to the callback. |
shared_ptr<ucxx::Listener> object.