Class used to test the unix asynchronous stream acceptor API.
More...
|
| void | SetUp () override |
| | Sets up the test fixture.
|
| |
|
| static Tcp::AsyncSocket & | peer () |
| | get the socket receiving the accepted connections.
|
| |
| static void | onReport (Tcp::Socket &&sock, const std::error_code &ec, bool more) |
| | report a completion to the test thread.
|
| |
| static void | onAccept (Tcp::Socket &&sock, const std::error_code &ec, bool more) |
| | handler resubmitting an acceptation from within itself.
|
| |
| static void | onSlowReport (Tcp::Socket &&sock, const std::error_code &ec, bool more) |
| | handler delaying its report to widen the completion window.
|
| |
| static void | onAcceptAndClose (Tcp::Socket &&sock, const std::error_code &ec, bool more) |
| | handler closing the acceptor from within itself.
|
| |
|
| static const IpAddress | _address = "::1" |
| | acceptor address.
|
| |
| static const uint16_t | _port = 5033 |
| | acceptor port.
|
| |
| static const std::chrono::milliseconds | _timeout {1000} |
| | completion timeout.
|
| |
| static Mutex | _mut |
| | condition mutex.
|
| |
| static Condition | _cond |
| | condition variable.
|
| |
| static std::error_code | _code |
| | last reported error.
|
| |
| static int | _completions = 0 |
| | number of completions reported.
|
| |
| static bool | _more = false |
| | last reported multishot state.
|
| |
| static Tcp::AsyncAcceptor * | _current = nullptr |
| | acceptor used by the resubmitting handler.
|
| |
Class used to test the unix asynchronous stream acceptor API.
◆ onAccept()
| static void TcpAsyncAcceptor::onAccept |
( |
Tcp::Socket && | sock, |
|
|
const std::error_code & | ec, |
|
|
bool | more ) |
|
inlinestaticprotected |
handler resubmitting an acceptation from within itself.
- Parameters
-
| sock | accepted socket. |
| ec | error reported by the acceptor. |
| more | true if the acceptation stays armed. |
◆ onAcceptAndClose()
| static void TcpAsyncAcceptor::onAcceptAndClose |
( |
Tcp::Socket && | sock, |
|
|
const std::error_code & | ec, |
|
|
bool | more ) |
|
inlinestaticprotected |
handler closing the acceptor from within itself.
- Parameters
-
| sock | accepted socket. |
| ec | error reported by the acceptor. |
| more | true if the acceptation stays armed. |
◆ onReport()
| static void TcpAsyncAcceptor::onReport |
( |
Tcp::Socket && | sock, |
|
|
const std::error_code & | ec, |
|
|
bool | more ) |
|
inlinestaticprotected |
report a completion to the test thread.
- Parameters
-
| sock | accepted socket. |
| ec | error reported by the acceptor. |
| more | true if the acceptation stays armed. |
◆ onSlowReport()
| static void TcpAsyncAcceptor::onSlowReport |
( |
Tcp::Socket && | sock, |
|
|
const std::error_code & | ec, |
|
|
bool | more ) |
|
inlinestaticprotected |
handler delaying its report to widen the completion window.
- Parameters
-
| sock | accepted socket. |
| ec | error reported by the acceptor. |
| more | true if the acceptation stays armed. |
◆ peer()
| static Tcp::AsyncSocket & TcpAsyncAcceptor::peer |
( |
| ) |
|
|
inlinestaticprotected |
get the socket receiving the accepted connections.
- Returns
- the socket receiving the accepted connections.
◆ SetUp()
| void TcpAsyncAcceptor::SetUp |
( |
| ) |
|
|
inlineoverrideprotected |
Sets up the test fixture.
◆ _address
| const IpAddress TcpAsyncAcceptor::_address = "::1" |
|
staticprotected |
◆ _code
| std::error_code TcpAsyncAcceptor::_code |
|
staticprotected |
◆ _completions
| int TcpAsyncAcceptor::_completions = 0 |
|
staticprotected |
number of completions reported.
◆ _cond
◆ _current
| Tcp::AsyncAcceptor * TcpAsyncAcceptor::_current = nullptr |
|
staticprotected |
acceptor used by the resubmitting handler.
◆ _more
| bool TcpAsyncAcceptor::_more = false |
|
staticprotected |
last reported multishot state.
◆ _mut
| Mutex TcpAsyncAcceptor::_mut |
|
staticprotected |
◆ _port
| const uint16_t TcpAsyncAcceptor::_port = 5033 |
|
staticprotected |
◆ _timeout
| const std::chrono::milliseconds TcpAsyncAcceptor::_timeout {1000} |
|
staticprotected |
The documentation for this class was generated from the following file: