how to realize that a connection is closed by a client
Hi All I am doing first steps with boost::asio and I want to use ip::tcp::stream to send data from a server to a client. Reading the sample in boost docs I did a first sample of server code. Is there any way for the server to check if a client connection is closed or gone at some point? for( ;; ){ boost::asio::ip::tcp::iostream stream; acceptor.accept( *stream.rdbuf() ); for( int i = 0; i < 10; i++ ){ stream << "message" << i << std::endl; // how to realize that the client has gone here? boost::this_thread::sleep( boost::posix_time::milliseconds(1000) ); }
Is there any way for the server to check if a client connection is closed or gone at some point?
http://groups.google.com/group/boost-list/browse_thread/thread/0ff49116ea482...
Thanks you very much
CS
On Tue, Feb 16, 2010 at 12:26 PM, Igor R
Is there any way for the server to check if a client connection is closed or gone at some point?
http://groups.google.com/group/boost-list/browse_thread/thread/0ff49116ea482... _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Conoscenza Silente
-
Igor R