It works nicely, this is a good example of using ASIO.
The CMakeLists.txt file could have been made more minimal but I hope
people find the extra bits useful as templates.
Regards
Andrew
On Tue, Sep 30, 2008 at 7:49 PM, Jeff Gray
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ___________________________________________ Andrew J. P. Maclean Centre for Autonomous Systems The Rose Street Building J04 The University of Sydney 2006 NSW AUSTRALIA Ph: +61 2 9351 3283 Fax: +61 2 9351 7474 URL: http://www.acfr.usyd.edu.au/ ___________________________________________