Compare commits
2 Commits
4f9a671bdc
...
7806b64783
Author | SHA1 | Date | |
---|---|---|---|
7806b64783 | |||
253b182c45 |
@ -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,8 +58,8 @@ auto slige_rpc::RpcServer<Functor>::listen() -> Res<Unit>
|
||||
continue;
|
||||
}
|
||||
auto req = sliger::json::parse_json(message);
|
||||
auto writer = BufferedWriter(client);
|
||||
this->functor(req, writer);
|
||||
auto writer = std::make_unique<BufferedWriter>(client);
|
||||
this->functor(req, std::move(writer));
|
||||
message.clear();
|
||||
break;
|
||||
}
|
||||
|
@ -63,6 +63,10 @@ public:
|
||||
: fd(fd)
|
||||
{
|
||||
}
|
||||
BufferedWriter(const BufferedWriter&) = delete;
|
||||
BufferedWriter operator=(const BufferedWriter&) = delete;
|
||||
BufferedWriter(BufferedWriter&&) = delete;
|
||||
BufferedWriter operator=(BufferedWriter&&) = delete;
|
||||
~BufferedWriter() { close(fd); }
|
||||
|
||||
auto flush() -> Res<size_t>;
|
||||
|
Loading…
Reference in New Issue
Block a user