mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 13:48:53 +02:00
ircd::net::listener: Add some doc comments on the structure.
This commit is contained in:
parent
a08d5370f8
commit
d7edd1960e
3 changed files with 14 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
// is part of the <ircd/asio.h> stack which can be included in your
|
// is part of the <ircd/asio.h> stack which can be included in your
|
||||||
// definition file if you need low level access to this acceptor API.
|
// definition file if you need low level access to this acceptor API.
|
||||||
|
|
||||||
|
/// Implementation to net::listener. See listener.h for additional interface.
|
||||||
struct ircd::net::acceptor
|
struct ircd::net::acceptor
|
||||||
:std::enable_shared_from_this<struct ircd::net::acceptor>
|
:std::enable_shared_from_this<struct ircd::net::acceptor>
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,8 +55,8 @@ struct ircd::net::ipport
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
bool operator!() const { return !static_cast<bool>(*this); }
|
bool operator!() const { return !static_cast<bool>(*this); }
|
||||||
|
|
||||||
explicit operator const ipaddr &() const;
|
operator const ipaddr &() const;
|
||||||
explicit operator ipaddr &();
|
operator ipaddr &();
|
||||||
|
|
||||||
template<class iparg> ipport(iparg&&, const uint16_t &port);
|
template<class iparg> ipport(iparg&&, const uint16_t &port);
|
||||||
template<class iparg> ipport(iparg&&, const string_view &port);
|
template<class iparg> ipport(iparg&&, const string_view &port);
|
||||||
|
|
|
@ -33,6 +33,17 @@ namespace ircd::net
|
||||||
bool stop(acceptor &);
|
bool stop(acceptor &);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This object is a wrapper interface to the internal net::acceptor object
|
||||||
|
/// which contains boost assets which we cannot forward declare here. It
|
||||||
|
/// implicitly converts as a reference to the internal acceptor. Users wishing
|
||||||
|
/// to listen on a network interface for incoming connections create and hold
|
||||||
|
/// an instance of this object.
|
||||||
|
///
|
||||||
|
/// The configuration is provided in JSON. The operations are asynchronous on
|
||||||
|
/// the main stack and connected sockets are called back in callback. There is
|
||||||
|
/// also a proffer callback which is made as early as possible (before the SSL
|
||||||
|
/// handshake, and ideally if the platform supports it before a SYN-ACK) to
|
||||||
|
/// reject connections by returning false.
|
||||||
struct ircd::net::listener
|
struct ircd::net::listener
|
||||||
{
|
{
|
||||||
using callback = std::function<void (listener &, const std::shared_ptr<socket> &)>;
|
using callback = std::function<void (listener &, const std::shared_ptr<socket> &)>;
|
||||||
|
|
Loading…
Reference in a new issue