Home
libucxx
libucxx
ucxx
nightly (0.53)
nightly (0.53)
stable (0.52)
legacy (0.51)
Toggle main menu visibility
Loading...
Searching...
No Matches
include
ucxx
listener.h
1
5
#pragma once
6
7
#include <memory>
8
#include <string>
9
10
#include <ucp/api/ucp.h>
11
12
#include <ucxx/component.h>
13
#include <ucxx/endpoint_builder.h>
14
#include <ucxx/listener_builder.h>
15
#include <ucxx/worker.h>
16
17
namespace
ucxx
{
18
19
class
Listener
;
26
class
Listener :
public
Component
{
27
private
:
28
ucp_listener_h _handle{
nullptr
};
29
std::string _ip{};
30
uint16_t _port{0};
31
53
Listener(std::shared_ptr<Worker> worker,
54
std::string host,
55
uint16_t port,
56
ucp_listener_conn_callback_t callback,
57
void
* callbackArgs);
58
59
public
:
60
Listener() =
delete
;
61
Listener(
const
Listener&) =
delete
;
62
Listener& operator=(Listener
const
&) =
delete
;
63
Listener(Listener&& o) =
delete
;
64
Listener& operator=(Listener&& o) =
delete
;
65
66
~Listener();
67
68
// Allow internal construction without exposing factory functions.
69
friend
class
detail::ConstructorFactory;
70
80
[[nodiscard]]
EndpointBuilder
endpointBuilder
(ucp_conn_request_h connRequest);
81
97
[[nodiscard]] ucp_listener_h
getHandle
();
98
106
[[nodiscard]] uint16_t
getPort
();
107
115
[[nodiscard]] std::string
getIp
();
116
};
117
118
}
// namespace ucxx
ucxx::Component
A UCXX component class to prevent early destruction of parent object.
Definition
component.h:21
ucxx::EndpointBuilder
Builder class for constructing std::shared_ptr<ucxx::Endpoint> objects.
Definition
endpoint_builder.h:28
ucxx::Listener
Component encapsulating a UCP listener.
Definition
listener.h:26
ucxx::Listener::endpointBuilder
EndpointBuilder endpointBuilder(ucp_conn_request_h connRequest)
Create a builder for an endpoint from a connection request.
ucxx::Listener::getIp
std::string getIp()
Get the IP address to which the listener is bound to.
ucxx::Listener::getHandle
ucp_listener_h getHandle()
Get the underlying ucp_listener_h handle.
ucxx::Listener::getPort
uint16_t getPort()
Get the port to which the listener is bound to.
ucxx
Definition
address.h:16
Generated by
1.18.0