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

Function SendStreamData

src/brpc/policy/streaming_rpc_protocol.cpp:165–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165int SendStreamData(Socket* sock, const butil::IOBuf* data,
166 int64_t remote_stream_id, int64_t source_stream_id,
167 bthread_id_t response_id) {
168 CHECK(sock != NULL);
169 StreamFrameMeta fm;
170 fm.set_stream_id(remote_stream_id);
171 fm.set_source_stream_id(source_stream_id);
172 fm.set_frame_type(FRAME_TYPE_DATA);
173 fm.set_has_continuation(false);
174 butil::IOBuf out;
175 PackStreamMessage(&out, fm, data);
176 Socket::WriteOptions wopt;
177 if (INVALID_BTHREAD_ID != response_id) {
178 wopt.id_wait = response_id;
179 wopt.notify_on_success = true;
180 }
181 wopt.ignore_eovercrowded = true;
182 return sock->Write(&out, &wopt);
183}
184
185} // namespace policy
186} // namespace brpc

Callers 1

Calls 2

PackStreamMessageFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected