Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
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
"
16
#include "
roc_netio/iconn_handler.h
"
17
18
namespace
roc
{
19
namespace
netio
{
20
21
//! Connection acceptor interface.
22
//! @remarks
23
//! - Methods are called from the network loop thread.
24
//! - Methods should not block.
25
class
IConnAcceptor
{
26
public
:
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.
38
virtual
IConnHandler
*
add_connection
(
IConn
&) = 0;
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_
roc::netio::IConnAcceptor
Connection acceptor interface.
Definition
iconn_acceptor.h:25
roc::netio::IConnAcceptor::remove_connection
virtual void remove_connection(IConnHandler &)=0
Called after connection termination.
roc::netio::IConnAcceptor::add_connection
virtual IConnHandler * add_connection(IConn &)=0
Called for every new incoming connection.
roc::netio::IConnHandler
Connection event handler interface.
Definition
iconn_handler.h:60
roc::netio::IConn
Connection interface.
Definition
iconn.h:30
iconn.h
Connection interface.
iconn_handler.h
Connection event handler interface.
roc::netio
Network I/O.
roc
Root namespace.
roc_netio
target_libuv
roc_netio
iconn_acceptor.h
Generated by
1.17.0