Boost logo

Boost :

Subject: [boost] [asio] experience with cygwin
From: bnv_at_[hidden]
Date: 2009-03-16 10:02:36


I began porting a cygwin application to boost-1.38 asio this past weekend. So far things are working, and I'm pleased with the simplification of the application code, but a few items have come up...

1. The cygwin documentation only states that the __USE_W32_SOCKETS flag must be defined, but the documentation should also mention that the _WIN32_WINNT flag should be defined (0x0501 for XP) to avoid a warning, and that the ws2_32 and mswsock libraries are needed (at least for XP).

2. The documentation for the ip::tcp::socket object specifies that the cancel() member will "cancel all asynchronous operations associated with the socket". However, when called just before closing the socket, I get an exception along the lines of "operation not supported on this object" (I don't have the exact message in front of me right now). By not calling it, my async handlers are invoked with an error on closing the socket.

3. The application has a signal handler (e.g., SIGINT). However, when the process is inside asio::io_service::run(), the signal handler appears to somehow get suspended and I have to do a "kill -9" rather than just hitting ctrl-c. Is this intentional/expected? Is there a work around, perhaps looping on asio::io_service::run_one()?

Thanks,
Brian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk