[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Handling BEV_EVENT_ERROR
- To: "libevent-users" <libevent-users@xxxxxxxxxxxxx>
- Subject: [Libevent-users] Handling BEV_EVENT_ERROR
- From: Developer <dev@xxxxxxx>
- Date: Sun, 29 Mar 2020 18:31:02 +0300
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=mlbx.cc; spf=pass smtp.mailfrom=dev@xxxxxxx; dmarc=pass header.from=<dev@xxxxxxx> header.from=<dev@xxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585495863; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=ukTz/D7mXWaQ9/RpS4swQ8uNQe6zMeb06xCuidulbZ0=; b=ThXJCLdbgWbnP17VNNqEOVocu6KDjjR9WMCmZHWV1uSkmkGmhOMQtWkDsddR9mtoTy0r7v/53S1FxJULi4We3MyvwYPeoGU7FxqdmtYk8lub1A08oSg+8lUg6YyTVbrPqOFBc5LL9BYOhJDpOmKw4xzCyfj3JNPcY4msHEmOVFk=
- Arc-seal: i=1; a=rsa-sha256; t=1585495863; cv=none; d=zohomail.com; s=zohoarc; b=Bj1hVfr0fRUiHr5bVg/e0XOn7nvqRN8oVkMqjWb8JQBLfbj76URsq8FQotR/RHZYx1VMLzvZ8t4nX1TzzgmqWOC/Z+GlMyEVjjm3M0JTprjAlrhKoViUJhqdBewTZJwr7xttutGOihvP8pcJfUX0mcd13t4cK4oTwGD+jmQF0k8=
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Sun, 29 Mar 2020 11:46:13 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1585495863; s=zoho; d=mlbx.cc; i=dev@xxxxxxx; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=ukTz/D7mXWaQ9/RpS4swQ8uNQe6zMeb06xCuidulbZ0=; b=BraMcKa91HGVATpT3SfPk8MpIKSHri+637O/qLKKE4ZYqeeG8bDNUH49Gy5thbur GgI+1WsFkAlTU5jUYtpU8W9eTJcxMMcd5G8nC6rmRA24uuqrsGuvyL51tT0+cnFk7fZ 1+XstHDHByKk7LSGodmns9jxAir9EEV3KYwByGpo=
- Importance: Medium
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
- User-agent: Zoho Mail
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.