Builder class for constructing std::shared_ptr<ucxx::Listener> objects. More...
#include <listener_builder.h>
Public Member Functions | |
| ListenerBuilder (std::shared_ptr< Worker > worker, uint16_t port, ucp_listener_conn_callback_t callback, void *callbackArgs) | |
| Constructor for ListenerBuilder. | |
| ~ListenerBuilder () | |
| ListenerBuilder destructor. | |
| ListenerBuilder (const ListenerBuilder &other) | |
| Copy constructor (deep-copies internal state). | |
| ListenerBuilder & | operator= (const ListenerBuilder &other) |
| Copy assignment operator (deep-copies internal state). | |
| ListenerBuilder (ListenerBuilder &&) noexcept | |
| Move constructor. | |
| ListenerBuilder & | operator= (ListenerBuilder &&) noexcept |
| Move assignment operator. | |
| operator std::shared_ptr< Listener > () | |
| Implicit conversion operator to shared_ptr<Listener>. | |
| ListenerBuilder & | host (std::string host) |
| Set the hostname or IP address the listener should bind to. | |
| std::shared_ptr< Listener > | build () |
| Build and return the Listener. | |
Builder class for constructing std::shared_ptr<ucxx::Listener> objects.
This class implements the builder pattern for std::shared_ptr<ucxx::Listener>. Construction happens when build() is called or when the builder is implicitly converted to std::shared_ptr<Listener>.
| ucxx::ListenerBuilder::ListenerBuilder | ( | std::shared_ptr< Worker > | worker, |
| uint16_t | port, | ||
| ucp_listener_conn_callback_t | callback, | ||
| void * | callbackArgs ) |
Constructor for ListenerBuilder.
| [in] | worker | worker from which to create the listener. |
| [in] | port | port which the listener should bind to. |
| [in] | callback | callback to execute on incoming connections. |
| [in] | callbackArgs | argument to pass to the callback. |
|
nodiscard |
Build and return the Listener.
Each call to build() creates a new Listener instance with the current parameters.
| ListenerBuilder & ucxx::ListenerBuilder::host | ( | std::string | host | ) |
Set the hostname or IP address the listener should bind to.
By default the listener binds to all interfaces (wildcard). Use this to restrict the listener to a specific interface, e.g., "127.0.0.1" to accept connections from the local host only.
| [in] | host | hostname or IP address the listener should bind to, an empty string binds to all interfaces. |
| ucxx::ListenerBuilder::operator std::shared_ptr< Listener > | ( | ) |
Implicit conversion operator to shared_ptr<Listener>.