Compare commits
2 Commits
4f9a671bdc
...
7806b64783
Author | SHA1 | Date | |
---|---|---|---|
7806b64783 | |||
253b182c45 |
@ -1,5 +1,6 @@
|
|||||||
#include "rpc_server.hpp"
|
#include "rpc_server.hpp"
|
||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
|
#include <memory>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -57,8 +58,8 @@ auto slige_rpc::RpcServer<Functor>::listen() -> Res<Unit>
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto req = sliger::json::parse_json(message);
|
auto req = sliger::json::parse_json(message);
|
||||||
auto writer = BufferedWriter(client);
|
auto writer = std::make_unique<BufferedWriter>(client);
|
||||||
this->functor(req, writer);
|
this->functor(req, std::move(writer));
|
||||||
message.clear();
|
message.clear();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,10 @@ public:
|
|||||||
: fd(fd)
|
: fd(fd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
BufferedWriter(const BufferedWriter&) = delete;
|
||||||
|
BufferedWriter operator=(const BufferedWriter&) = delete;
|
||||||
|
BufferedWriter(BufferedWriter&&) = delete;
|
||||||
|
BufferedWriter operator=(BufferedWriter&&) = delete;
|
||||||
~BufferedWriter() { close(fd); }
|
~BufferedWriter() { close(fd); }
|
||||||
|
|
||||||
auto flush() -> Res<size_t>;
|
auto flush() -> Res<size_t>;
|
||||||
|
Loading…
Reference in New Issue
Block a user