libevent :: Connection :: event_callback
Returns true
if the native handles to self
can be released.
# Callback method on events: EOF, user-defined timeout and unrecoverable errors
#
# Returns `true` if the native handles to `self` can be released.
fun event_callback(events: Int): Bool
do
if events & bev_event_error != 0 or events & bev_event_eof != 0 then
if events & bev_event_error != 0 then
var sock_err = evutil_socket_error
# Ignore some normal errors and print the others for debugging
if sock_err == 110 then
# Connection timed out (ETIMEDOUT)
else if sock_err == 104 then
# Connection reset by peer (ECONNRESET)
else
print_error "libevent error event: {evutil_socket_error_to_string(sock_err)} ({sock_err})"
end
end
force_close
return true
end
return false
end
lib/libevent/libevent.nit:208,2--230,4