asio: selective cancellation of reads/writes

Hi, In asio, if I have a socket with pending asynchronous reads and writes, is there a way to selectively cancel only the reads or only the writes? All I can find is basic_stream_socket::cancel() which closes *all* pending operations on the socket. Thanks for any help, Alex

Alexander Fritze
In asio, if I have a socket with pending asynchronous reads and writes, is there a way to selectively cancel only the reads or only the writes? All I can find is basic_stream_socket::cancel() which closes *all* pending operations on the socket.
Is socket::shutdown() what you're looking for? http://www.boost.org/doc/html/boost_asio/reference/basic_socket/shutdown.htm... However, I'm not sure if it cancels all corresponding pending operations or just puts them on hold.

On 13. Jan2010, at 3:00 , Maxim Yanchenko wrote:
Alexander Fritze
writes: In asio, if I have a socket with pending asynchronous reads and writes, is there a way to selectively cancel only the reads or only the writes? All I can find is basic_stream_socket::cancel() which closes *all* pending operations on the socket.
Is socket::shutdown() what you're looking for?
http://www.boost.org/doc/html/boost_asio/reference/basic_socket/shutdown.htm...
However, I'm not sure if it cancels all corresponding pending operations or just puts them on hold.
Hmm, interesting, shutdown() wasn't exactly what I was looking for, but it does actually work for my particular situation. Thanks! Alex
participants (2)
-
Alexander Fritze
-
Maxim Yanchenko