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

Function non_zero_error_code

src/brpc/socket.h:808–811  ·  view source on GitHub ↗

_error_code is set after a socket becomes failed, during the time gap, _error_code is 0. The race condition is by-design and acceptable. To always get a non-zero error_code, readers should call this method instead of reading _error_code directly.

Source from the content-addressed store, hash-verified

806 // To always get a non-zero error_code, readers should call this method
807 // instead of reading _error_code directly.
808 int non_zero_error_code() const {
809 const int tmp = _error_code;
810 return tmp ? tmp : EFAILEDSOCKET;
811 }
812
813 void CancelUnwrittenBytes(size_t bytes);
814

Callers 3

NotifyOnFailedMethod · 0.85
ConductErrorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected