Boost logo

Boost Users :

Subject: Re: [Boost-users] Simple telnet client demonstration with boost asio asynchronous I/O
From: Jeff Gray (jeffg_at_[hidden])
Date: 2008-09-30 05:49:38


Andrew Maclean wrote:
> Here is a CMakeLists.txt file that will let you use CMake
> (http://www.cmake.org) to create either a visual studio solution or a
> kdevelop/unix makefile solution. Your code builds with no errors using
> Visual Studio 2008 and (of course) Linux (Debian), I haven't tried a
> mac.

Thanks for that Andrew. Nice to see an easy portable build system.

I've worked on Roland Bock's suggestion of timeouts to handle failure to
connect & attached the working code.

When an error occurs in the class, in my example code, it sets a
variable which is checked by the main thread. I'm sure there are better
built in ways of dealing with this for Boost asio or threads.

Presumably, when the socket is closed, this means the io_service.run()
function returns and the thread is terminated. If anyone has any
suggestions how to detect any of this from the main thread to determine
when to exit, I'd like to hear them.

Regards,
Jeff




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net