Boost logo

Boost Users :

Subject: [Boost-users] Reading response without blocking
From: Kumar, Akhilesh (Akhilesh.Kumar_at_[hidden])
Date: 2010-02-09 14:37:06


Hi,

I am using boost ASIO for uploading file to a http server(I had everything working using WinInet but switching to boost::ASIO for portability reason.). I have upload working but at the end of upload I want to read the response from the server, but I am not sure how to find that there is not more data on the wire.

I am using sync socket, so my call are blocking if there is no more data, here is what I need to know.
How do I make sure that my call does not block if there is no more data?
Or how do I know that there is no more data on the wire so don't try to read it?
IS there any call which simply check and return if there is no more data?

Can I use async read even though I am using sync socket for everything else. I don't' want to switch to async socket unless there is now way out of it.

As sample code will be welcome

Thanks,
Akhilesh



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