0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-03 01:09:05 +02:00

ircd::net::listener: Add some doc comments on the structure.

This commit is contained in:
Jason Volk 2019-06-01 15:01:19 -07:00
parent a08d5370f8
commit d7edd1960e
3 changed files with 14 additions and 2 deletions

View file

@ -16,6 +16,7 @@
// 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.
/// Implementation to net::listener. See listener.h for additional interface.
struct ircd::net::acceptor
:std::enable_shared_from_this<struct ircd::net::acceptor>
{

View file

@ -55,8 +55,8 @@ struct ircd::net::ipport
explicit operator bool() const;
bool operator!() const { return !static_cast<bool>(*this); }
explicit operator const ipaddr &() const;
explicit operator ipaddr &();
operator const ipaddr &() const;
operator ipaddr &();
template<class iparg> ipport(iparg&&, const uint16_t &port);
template<class iparg> ipport(iparg&&, const string_view &port);

View file

@ -33,6 +33,17 @@ namespace ircd::net
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
{
using callback = std::function<void (listener &, const std::shared_ptr<socket> &)>;