MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / RPCWrite

Method RPCWrite

examples/rpc/client.cpp:96–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96ssize_t ExampleClient::RPCWrite(photon::net::EndPoint ep, const std::string& fn,
97 struct iovec* iovec, int iovcnt) {
98 WriteBuffer::Request req;
99 req.fn.assign(fn);
100 req.buf.assign(iovec, iovcnt);
101 WriteBuffer::Response resp;
102 int ret = 0;
103
104 auto stub = pool->get_stub(ep, false);
105 if (!stub) return -1;
106 DEFER(pool->put_stub(ep, ret < 0));
107
108 ret = stub->call<WriteBuffer>(req, resp);
109 if (ret < 0) return ret;
110 return resp.ret;
111}
112
113void ExampleClient::RPCTestrun(photon::net::EndPoint ep) {
114 Testrun::Request req;

Callers 1

run_some_task_and_stopFunction · 0.80

Calls 3

put_stubMethod · 0.80
assignMethod · 0.45
get_stubMethod · 0.45

Tested by

no test coverage detected