integrationtest.httpserver.main

Test-suite for the task based HTTP server.

This test uses a TCP socket connection to localhost:8080.

FLAKY: the unittests in this module are a bit flaky, as they rely on making various system calls (socket, connect, read/write, epoll API functions, etc) which could, under certain environmental conditions, fail.

Members

Classes

ClientTask
class ClientTask

HTTP client task. It sends one HTTP GET request and receives and parses the response, expecting response_payload as the response payload.

ResponseParser
class ResponseParser

Stores and parses the response data which readConsume outputs.

TestHttpHandler
class TestHttpHandler

Task-based HTTP connection handler supporting only HTTP GET with response_payload as the response payload.

Functions

main
int main()
Undocumented in source. Be warned that the author may not have intended to support it.
memmem
inout(void)* memmem(inout(void)* a_ptr, size_t a_len, const(void)* b_ptr, size_t b_len)

glibc function. Looks for b_ptr[0 .. b_len] in a_ptr[0 .. a_len] and returns - a pointer to the first occurrence if found or - null if not found or - a_ptr if b_len == 0.

Static variables

response_payload
auto response_payload;

The payload of the HTTP response.

Variables

srv_address
IPSocket!().InetAddress srv_address;

The server address, initialised in main and used by both the server and the client.

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).