|
join 1.0
lightweight network framework library
|
Class used to test the udp asynchronous datagram socket API. More...


Protected Member Functions | |
| void | SetUp () override |
| Sets up the test fixture. | |
| void | TearDown () override |
| Tears down the test fixture. | |
Static Protected Member Functions | |
| static Udp::AsyncSocket & | server () |
| get the echo server socket. | |
| static void | onEchoRead (const std::error_code &ec, const char *data, size_t size, const Udp::Endpoint &from, bool more) |
| send back the datagram received by the echo server. | |
| static void | onEchoWrite (const std::error_code &ec, size_t size) |
| wait for the next datagram to echo. | |
| static void | onReport (const std::error_code &ec, size_t size) |
| report a completion to the test thread. | |
| static void | onReportRead (const std::error_code &ec, const char *data, size_t size, bool more) |
| report a read completion to the test thread. | |
| static void | onReportFrom (const std::error_code &ec, const char *data, size_t size, const Udp::Endpoint &from, bool more) |
| report a read completion and the endpoint it came from to the test thread. | |
| static void | onReportMulti (const std::error_code &ec, const char *data, size_t size, const Udp::Endpoint &from, bool more) |
| report a multishot completion to the test thread. | |
| static void | onRead (const std::error_code &ec, const char *data, size_t size, const Udp::Endpoint &from, bool more) |
| handler resubmitting a read from within itself. | |
| static void | onWrite (const std::error_code &ec, size_t size) |
| handler resubmitting a write from within itself. | |
| static Udp::AsyncSocket & | moved () |
| get the socket receiving the move performed from a handler. | |
| static void | onReadAndMove (const std::error_code &ec, const char *data, size_t size, const Udp::Endpoint &from, bool more) |
| handler moving the socket from within itself. | |
| static void | onWriteAndClose (const std::error_code &ec, size_t size) |
| handler closing the socket from within itself. | |
| static void | onReportWait (const std::error_code &ec, bool more) |
| report a wait completion to the test thread. | |
Static Protected Attributes | |
| 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 size_t | _transferred = 0 |
| number of bytes reported by the last completion. | |
| static char | _buf [1024] = {} |
| read buffer. | |
| static Udp::Endpoint | _from |
| endpoint the last datagram was received from. | |
| static bool | _more = false |
| last reported multishot state. | |
| static char | _echobuf [1024] = {} |
| buffer used by the echo server. | |
| static Udp::Endpoint | _echofrom |
| endpoint the echo server received the last datagram from. | |
| static Udp::AsyncSocket * | _current = nullptr |
| socket used by the resubmitting handler. | |
| static int | _rearms = 0 |
| number of resubmissions left to perform from a handler. | |
| static Udp::Endpoint | _dest |
| destination used by the resubmitting write handler. | |
| static const std::string | _host = "127.0.0.1" |
| host. | |
| static const uint16_t | _port = 5036 |
| port. | |
| static const std::chrono::milliseconds | _timeout {1000} |
| timeout. | |
Class used to test the udp asynchronous datagram socket API.
|
inlinestaticprotected |
get the socket receiving the move performed from a handler.
|
inlinestaticprotected |
send back the datagram received by the echo server.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| from | endpoint the datagram was received from. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
wait for the next datagram to echo.
| ec | error reported by the socket. |
| size | number of bytes written. |
|
inlinestaticprotected |
handler resubmitting a read from within itself.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| from | endpoint the datagram was received from. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
handler moving the socket from within itself.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| from | endpoint the datagram was received from. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
report a completion to the test thread.
| ec | error reported by the socket. |
| size | number of bytes transferred. |
|
inlinestaticprotected |
report a read completion and the endpoint it came from to the test thread.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| from | endpoint the datagram was received from. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
report a multishot completion to the test thread.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| from | endpoint the datagram was received from. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
report a read completion to the test thread.
| ec | error reported by the socket. |
| data | buffer holding the data received. |
| size | number of bytes read. |
| more | true if the read stays armed. |
|
inlinestaticprotected |
report a wait completion to the test thread.
| ec | error reported by the socket. |
| more | true if the wait stays armed. |
|
inlinestaticprotected |
handler resubmitting a write from within itself.
| ec | error reported by the socket. |
| size | number of bytes written. |
|
inlinestaticprotected |
handler closing the socket from within itself.
| ec | error reported by the socket. |
| size | number of bytes written. |
|
inlinestaticprotected |
get the echo server socket.
|
inlineoverrideprotected |
Sets up the test fixture.
|
inlineoverrideprotected |
Tears down the test fixture.
|
staticprotected |
read buffer.
|
staticprotected |
last reported error.
|
staticprotected |
number of completions reported.
|
staticprotected |
condition variable.
|
staticprotected |
socket used by the resubmitting handler.
|
staticprotected |
destination used by the resubmitting write handler.
|
staticprotected |
buffer used by the echo server.
|
staticprotected |
endpoint the echo server received the last datagram from.
|
staticprotected |
endpoint the last datagram was received from.
|
staticprotected |
host.
|
staticprotected |
last reported multishot state.
|
staticprotected |
condition mutex.
|
staticprotected |
port.
|
staticprotected |
number of resubmissions left to perform from a handler.
|
staticprotected |
timeout.
|
staticprotected |
number of bytes reported by the last completion.