0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00
construct/include/ircd/net/listener.h

41 lines
988 B
C
Raw Normal View History

2018-02-04 03:22:01 +01:00
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
2017-10-19 10:30:19 +02:00
#pragma once
#define HAVE_IRCD_NET_LISTENER_H
namespace ircd::net
{
struct listener;
}
struct ircd::net::listener
{
struct acceptor;
using callback = std::function<void (const std::shared_ptr<socket> &)>;
2017-10-19 10:30:19 +02:00
IRCD_EXCEPTION(ircd::error, error)
private:
std::shared_ptr<struct acceptor> acceptor;
2017-10-19 10:30:19 +02:00
public:
listener(const string_view &name,
const json::object &options,
callback);
explicit
listener(const string_view &name,
const std::string &options,
callback);
2017-10-19 10:30:19 +02:00
~listener() noexcept;
};