error_code: avoid implicit conversion to int by removing bool() operator
and add int() operator
test_events: fixed a bug when incomplete write happens
test_socket: add multiple recv test