Hi,
Thank you for the nice library. Just a few observations:
The library doesn't seem to handle EINTR errors that happen when the program is interrupted by a signal and SA_RESTART flag is not set for the interrupt. It is not a major problem, but retrying the I/O operation will probably make things easier for the user.
From the synchronous example it seems that the handling of ping/pong messages is manual. It probably makes sense to add some kind of support for the automatic handling of PING/PONG messages, pretty much like Boost Beast handles them, if a client receives a frame from the server and a ping message is found, the corresponding pong message is sent automatically. This support for the automatic ping/pong handling can be configurable, so if the user wishes he could handle these messages manually.
Currently there is no way to call the synchronous read_message() method with a timeout. I think it is important to have support for a read timeout because the websocket can stay connected without receiving any data for a while and we cannot always rely on ping/pong messages to interrupt the blocking read.
Ideally there would be some way to interrupt the synchronous reads, e.g. by passing a std::stop_token to the read method, but I don't think that it can be implemented easily, because there is no easy way to poll simultaneously on a socket and a C++ synchronization primitive like conditional variable, semaphore, etc.
Hi, Thank you for the nice library. Just a few observations: