[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:19:15 +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=1585495156; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=ukTz/D7mXWaQ9/RpS4swQ8uNQe6zMeb06xCuidulbZ0=; b=cjVRkYMp9GbgAXadUttNrlOUe2BuNDpq1c4HJsJZU6PvscFICyeDQIVX8goybcLTgjFC6ewtg8ZSlm/gkB5ETy3RcF+RAFEwOxUyXIzqEctLk0QB7pyWzglZQ22NhMAZ0S9SxwU5v3JjkX03N/VPd/4fOnK0dE45Mys7IVMrzKY=
- Arc-seal: i=1; a=rsa-sha256; t=1585495156; cv=none; d=zohomail.com; s=zohoarc; b=GUY0MCuZywTVohiBkGU3PM2XF9ygZEFPCT+YwkkfGaeIN6eIM/o9TZBxPXZKxjTxHfhjEwa95bFEB0urOz4H7QoeDHmJoWbhzhBHYS8SNPLbx1msZIu4QQT/dDI1k3UybVnsrWivYo9s9iJW+snKBlsbJcgIFROrOsIYUuOVl7k=
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Sun, 29 Mar 2020 11:34:25 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1585495156; s=zoho; d=mlbx.cc; i=dev@xxxxxxx; h=Date:From:To:Message-ID:In-Reply-To:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=ukTz/D7mXWaQ9/RpS4swQ8uNQe6zMeb06xCuidulbZ0=; b=dGxSzmpTkXH9hU/HmfkgEXiL3TUzboRiWTLlcQ7TcvcCw9MK3N8R3JsxmnXNWJyx CH3wLe2Y17zAzQT+sOSvh/Ovde6j4Aslw+IfmCT9n73cmi10FTtxrCKmvIovTB3zGG6 E10U0Qc1joSbtxWfg1A3y9YA9BwfV74i3ztYpVMk=
- Importance: Medium
- In-reply-to:
- 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.