Boost logo

Boost Users :

Subject: Re: [Boost-users] Timeout on read/write using Boost.Asio
From: boost (boost_at_[hidden])
Date: 2012-04-18 19:47:51


hi,

Thanks for your reply.

I cancel the read/write on a tcp connection because the current node I connected to may be too busy to response, so I can try another node. 

I do not want cancel all async request because the other pending operations may finish successfully, the workload on peer node is very heavy instead of failure.

Anyway, I can cancel all request, but I still have the question about the cancel.

What if I cancel all the async operation, is there any partial data which has been read from or write to socket after the cancelation?

If partial data has been read from or write to socket, how can I issue both async read/write again?


Best Regards

Zhanwei Wang

----- Original Message -----From: Igor R <boost.lists@gmail.com>
To: boost-users@lists.boost.org

> 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.


Yes, you're right. You'll have to issue both async read and write again.
But usually "timeout" means that something goes wrong with the
connection (i.e. you expected something, but it failed to happen).
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

hi,

Thanks for your reply.

I cancel the read/write on a tcp connection because the current node I connected to may be too busy to response, so I can try another node.

I do not want cancel all async request because the other pending operations may finish successfully, the workload on peer node is very heavy instead of failure.

Anyway, I can cancel all request, but I still have the question about the cancel.

What if I cancel all the async operation, is there any partial data which has been read from or write to socket after the cancelation?

If partial data has been read from or write to socket, how can I issue both async read/write again?

Best Regards

Zhanwei Wang

----- Original Message -----From: Igor R <boost.lists_at_[hidden]>
To: boost-users_at_[hidden]

> 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.


Yes, you're right. You'll have to issue both async read and write again.
But usually "timeout" means that something goes wrong with the
connection (i.e. you expected something, but it failed to happen).
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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