Represents an nng_socket.
More...
#include <socket.h>
Represents an nng_socket.
Definition at line 70 of file socket.h.
◆ socket()
Construct a socket.
Definition at line 74 of file socket.h.
75 : router_m{r}
76 , socket_m{std::move(s)}
77 {
78 register_pipe_notify();
79 }
◆ ~socket()
| pars::net::socket::~socket |
( |
| ) |
|
|
inline |
◆ connect()
| void pars::net::socket::connect |
( |
const char * | addr, |
|
|
const cmode | mode ) |
|
inline |
◆ dial()
| void pars::net::socket::dial |
( |
const char * | addr | ) |
|
|
inline |
Definition at line 110 of file socket.h.
110{ emplace_dialer(addr).start().or_abort(); }
◆ format_to()
| auto pars::net::socket::format_to |
( |
std::format_context & | ctx | ) |
const -> decltype(ctx.out())
|
|
inline |
Definition at line 154 of file socket.h.
155 {
156 return std::format_to(
ctx.out(),
"Socket #{}-{}",
id(),
proto_name());
157 }
const char * proto_name() const
References proto_name().
◆ id()
| int pars::net::socket::id |
( |
| ) |
const |
|
inline |
◆ listen()
| void pars::net::socket::listen |
( |
const char * | addr | ) |
|
|
inline |
Definition at line 112 of file socket.h.
112{ emplace_listener(addr).start().or_abort(); }
◆ make_ctx()
Definition at line 129 of file socket.h.
129{ return nngxx::make_ctx(socket_m).value_or_abort(); }
◆ operator tool_view()
Definition at line 83 of file socket.h.
83{ return tool_view{socket_m}; }
◆ options()
Definition at line 100 of file socket.h.
101 {
102 return {
103 .recv_timeout = socket_m.get_recv_timeout().value_or_abort(),
104 .send_timeout = socket_m.get_send_timeout().value_or_abort(),
105 .req_resend_time = socket_m.get_req_resend_time().value_or_abort(),
106 .req_resend_tick = socket_m.get_req_resend_tick().value_or_abort(),
107 };
108 }
◆ proto_name()
| const char * pars::net::socket::proto_name |
( |
| ) |
const |
|
inline |
Definition at line 149 of file socket.h.
150 {
151 return socket_m.proto_name().value_or("<not-found>");
152 }
Referenced by format_to().
◆ recv()
| void pars::net::socket::recv |
( |
| ) |
|
|
inline |
Definition at line 141 of file socket.h.
141{ op_m.recv(router_m, *this); }
◆ recv_aio()
◆ send()
template<ev::event_c event_t>
| void pars::net::socket::send |
( |
event_t | ev, |
|
|
pipe | p = {} ) |
|
inline |
Definition at line 136 of file socket.h.
136 {})
137 {
138 op_m.send(router_m, *this, p, ev);
139 }
◆ send_aio()
◆ set_options()
| void pars::net::socket::set_options |
( |
const socket_opt | opts | ) |
|
|
inline |
◆ socket_id()
| int pars::net::socket::socket_id |
( |
| ) |
const |
|
inline |
◆ stop()
| void pars::net::socket::stop |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file:
- /home/runner/work/pars-cxx/pars-cxx/lib/include/pars/net/socket.h