ithewei / libhv

🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.

Home Page:https://github.com/ithewei/libhv/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why not http/websocket client callback error when it fails?

st751228051 opened this issue · comments

Now, http client only callback response or null, websocket client only callbak onclose with nothing. When it fails the user doesn't know why by coding.

libhv does not provide an error callback. I think it is not easy to use. Generally, if an error occurs, the socket can only be closed, so it can be handled in the onclose callback. The error code can be obtained through channel->error().