10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::test::fakes::FakeHttpServer Class Reference
Inheritance diagram for tenduke::test::fakes::FakeHttpServer:
tenduke::http::server::AbstractHTTPServer tenduke::http::server::HTTPServer

Public Member Functions

 FakeHttpServer (const std::shared_ptr< std::vector< std::string > > &requestedUrls, const std::shared_ptr< std::vector< std::shared_ptr< tenduke::test::fakes::FakeSocket > > > &responseSockets, const std::chrono::milliseconds &maxLifeTime=std::chrono::seconds(30))
 
uint16_t getPort () override
 Returns the port where this simple server is listening.
 
void start () override
 Starts the server.
 
void requestTo (const std::string &requestTarget)
 
bool isRunning () const
 
- Public Member Functions inherited from tenduke::http::server::AbstractHTTPServer
 AbstractHTTPServer (std::unique_ptr< tenduke::osa::Socket > socket)
 Constructs new instance.
 
void registerRoute (const std::string &route, const std::shared_ptr< tenduke::http::server::HTTPRequestHandler > &handler)
 Register a route.
 
void stop () override
 Stops the server.
 

Public Attributes

std::chrono::milliseconds maxLifeTime
 
const std::shared_ptr< std::deque< std::string > > requestQueue
 

Additional Inherited Members

- Protected Member Functions inherited from tenduke::http::server::AbstractHTTPServer
HTTPRequest parseRequest (const std::shared_ptr< tenduke::osa::Socket > &requestSocket) const
 Parses HTTP request from socket.
 
void handleRequest (tenduke::http::server::HTTPRequest request, tenduke::http::server::HTTPResponse response) const
 Handles HTTP request.
 
- Protected Attributes inherited from tenduke::http::server::AbstractHTTPServer
std::atomic_bool running
 Flag to indicate if the server is running.
 
std::map< std::string, std::shared_ptr< tenduke::http::server::HTTPRequestHandler > > routes
 Routes.
 

Member Function Documentation

◆ getPort()

uint16_t tenduke::test::fakes::FakeHttpServer::getPort ( )
overridevirtual

Returns the port where this simple server is listening.

Returns
-

Reimplemented from tenduke::http::server::AbstractHTTPServer.

◆ start()

void tenduke::test::fakes::FakeHttpServer::start ( )
overridevirtual

Starts the server.

Reimplemented from tenduke::http::server::AbstractHTTPServer.


The documentation for this class was generated from the following files: