v0.5.0
Close reasons
This library never intended to expose 50 billion different POSIX-style error codes like some other libraries do. Partly because we are not strictly tied to only POSIX or BSD, but can use any TCP implementation where such fine-grained error codes make no sense. Also, most users have no idea what any of those errors actually mean, or don't mean. Exposing way too detailed error codes would make things unnecessarily complex for users.
Instead we want a few granular, generic errors like (for instance):
- ABRUPT_CLOSE (such as TCP RST or the like)
- CLEAN_CLOSE (such as TCP FIN or the like)
- USER_TRIGGERED (custom reason, you the user triggered the close)
- PROTOCOL_ERROR (such as SSL protocol error, or TCP)
The above reasons are just examples, they are not actually used right now. This release adds the ability to pass close reasons around, and we will internally start using them where it makes sense to do so, with time.