Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
iconn_acceptor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_netio/target_libuv/roc_netio/iconn_acceptor.h
10//! @brief Connection acceptor interface.
11
12#ifndef ROC_NETIO_ICONN_ACCEPTOR_H_
13#define ROC_NETIO_ICONN_ACCEPTOR_H_
14
15#include "roc_netio/iconn.h"
17
18namespace roc {
19namespace netio {
20
21//! Connection acceptor interface.
22//! @remarks
23//! - Methods are called from the network loop thread.
24//! - Methods should not block.
26public:
27 virtual ~IConnAcceptor();
28
29 //! Called for every new incoming connection.
30 //!
31 //! @returns
32 //! IConnHandler object that will be notified when the connection state
33 //! changes and when it becomes readable and writeable.
34 //!
35 //! @remarks
36 //! It is the caller responsibility to ensure that the handler is not
37 //! destroyed until remove_connection() call.
39
40 //! Called after connection termination.
41 //!
42 //! @remarks
43 //! At this point, connection is already terminated and can't be used.
44 //! It's safe to destroy connection handler here.
45 virtual void remove_connection(IConnHandler&) = 0;
46};
47
48} // namespace netio
49} // namespace roc
50
51#endif // ROC_NETIO_ICONN_ACCEPTOR_H_
Connection acceptor interface.
virtual void remove_connection(IConnHandler &)=0
Called after connection termination.
virtual IConnHandler * add_connection(IConn &)=0
Called for every new incoming connection.
Connection event handler interface.
Connection interface.
Definition iconn.h:30
Connection interface.
Connection event handler interface.
Root namespace.