mirror of
https://github.com/Mercantec-GHC/h5-projekt-mst.git
synced 2026-08-27 13:47:38 +02:00
24 lines
412 B
C++
24 lines
412 B
C++
#include "http.hpp"
|
|
|
|
namespace mst {
|
|
auto HttpServer::start() -> Result<void>
|
|
{
|
|
while (1) {
|
|
auto res = this->listener.accept();
|
|
if (res) { }
|
|
}
|
|
};
|
|
|
|
auto HttpServer::bind(const std::string& host, uint16_t port)
|
|
-> Result<HttpServer>
|
|
{
|
|
auto x = TcpListener::bind(host, port);
|
|
|
|
if (!x) {
|
|
return std::unexpected(std::move(x.error()));
|
|
}
|
|
|
|
return HttpServer(*x);
|
|
}
|
|
}
|