[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Handling BEV_EVENT_ERROR



Hello,

I'm implementing a secure Websocket server backend with libevent (using the direct socket-based bufferevent approach, not filter-based). The sockets work in the non-blocking mode.
I've noticed that sometimes the buffevent event callback fires with `what` argument = `BEV_EVENT_ERROR|BEV_EVENT_READING`, but the reason isn't clear. `evutil_socket_geterror` called on the socket file descriptor returns 0 (which denotes success), and `bufferevent_get_openssl_error` called on the bufferevent also doesn't indicate any errors.
For now I'm dropping the connection immediately in the callback, but I'm not sure if this is the proper way, probably that event should be just ignored and the connection kept alive?
What else (apart from `evutil_socket_geterror` and `bufferevent_get_openssl_error`) should be inspected to get more information about the possible reason?

Thanks
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.