_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.
| 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 |
no outgoing calls
no test coverage detected