Boost logo

Boost Users :

Subject: [Boost-users] Timeout on read/write using Boost.Asio
From: boost (boost_at_[hidden])
Date: 2012-04-18 03:54:31



Hi everyone

I'm using boost asio to implement a tcp client in my project, and it is my first time of using asio.

I need timeout when read/write on the socket and I found the solution of using async io plus a timer, if timeout, cancel the async io operation.

My question is:

the "cancel" call acutely cancel all the pending async operation, but only one of them is timeout.

For example, there is a pending async read and a pending async write operation, only read is timeout, I do not want cancel write any way.

Any suggestion of the solution? Or I' m wrong?

Thanks

Hi everyone

I'm using boost asio to implement a tcp client in my project, and it is my first time of using asio.

I need timeout when read/write on the socket and I found the solution of using async io plus a timer, if timeout, cancel the async io operation.

My question is:

the "cancel" call acutely cancel all the pending async operation, but only one of them is timeout.

For example, there is a pending async read and a pending async write operation, only read is timeout, I do not want cancel write any way.

Any suggestion of the solution? Or I' m wrong?

Thanks


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