writer as unique ptr

This commit is contained in:
Theis Pieter Hollebeek 2024-11-21 11:38:44 +01:00
parent 253b182c45
commit 7806b64783

View File

@ -1,5 +1,6 @@
#include "rpc_server.hpp"
#include "json.hpp"
#include <memory>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
@ -57,7 +58,7 @@ auto slige_rpc::RpcServer<Functor>::listen() -> Res<Unit>
continue;
}
auto req = sliger::json::parse_json(message);
auto writer = BufferedWriter(client);
auto writer = std::make_unique<BufferedWriter>(client);
this->functor(req, std::move(writer));
message.clear();
break;