[asio] how to check connection state

1 Sep
2006
1 Sep
'06
12:22 p.m.
Hi boosters! I've written a simple client-server example using boost::asio::ip::tcp::socket. I establish the connection using socket::connect() and close it using socket::close(). But how can I determine the current state of connection (Am I still connected or not?) Is it sufficient to check whether the socket is open? Is there a function socket::is_open()? Or do I have to track errors for disconnection events and set some is_connected-flag somewhere. Btw what is the purpose of the keep_alive socket option? Thanks in advance Sascha
6804
Age (days ago)
6804
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sascha Seewald