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

Method BeforeRecycle

src/brpc/stream.cpp:129–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void Stream::BeforeRecycle(Socket *) {
130 // No one holds reference now, so we don't need lock here
131 bthread_id_list_reset(&_writable_wait_list, ECONNRESET);
132 if (_connected) {
133 // Send CLOSE frame
134 RPC_VLOG << "Send close frame";
135 CHECK(_host_socket != NULL);
136 policy::SendStreamClose(_host_socket,
137 _remote_settings.stream_id(), id());
138 }
139
140 if (_host_socket) {
141 _host_socket->RemoveStream(id());
142 }
143
144 // The instance is to be deleted in the consumer thread
145 bthread::execution_queue_stop(_consumer_queue);
146}
147
148ssize_t Stream::CutMessageIntoFileDescriptor(int /*fd*/,
149 butil::IOBuf **data_list,

Callers 1

CreateMethod · 0.45

Calls 6

bthread_id_list_resetFunction · 0.85
SendStreamCloseFunction · 0.85
idFunction · 0.85
execution_queue_stopFunction · 0.85
RemoveStreamMethod · 0.80
stream_idMethod · 0.45

Tested by

no test coverage detected