MCPcopy Create free account
hub / github.com/apache/brpc / WriteResponse

Method WriteResponse

test/brpc_esp_protocol_unittest.cpp:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 virtual void TearDown() {};
68
69 void WriteResponse(brpc::Controller& cntl, int msg) {
70 brpc::EspMessage req;
71
72 req.head.to.stub = STUB;
73 req.head.msg = msg;
74 req.head.msg_id = MSG_ID;
75 req.body.append(EXP_RESPONSE);
76
77 butil::IOBuf req_buf;
78 brpc::policy::SerializeEspRequest(&req_buf, &cntl, &req);
79
80 butil::IOBuf packet_buf;
81 brpc::policy::PackEspRequest(&packet_buf, NULL, cntl.call_id().value, NULL, &cntl, req_buf, NULL);
82
83 packet_buf.cut_into_file_descriptor(_pipe_fds[1], packet_buf.size());
84 }
85
86 int _pipe_fds[2];
87 brpc::SocketUniquePtr _socket;

Callers

nothing calls this directly

Calls 6

SerializeEspRequestFunction · 0.85
PackEspRequestFunction · 0.85
call_idMethod · 0.80
appendMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected