Well I was thinking along the lines of:
IAsyncResult ar = strm.BeginRead(buf, 0, buf.Length, null, null);
bool completed = ar.AsyncWaitHandle.WaitOne(60 * 1000, false);
if (!completed)
{
// Read timed-out. So close the connection. This will cause the
// async op to complete, and EndRead will throw a suitable exception.
strm.Close(); // EndRead throws ObjectDisposedException
//cli.Close(); // EndRead throws IOException
}
int bytesRead = strm.EndRead(ar);
//... do stuff with the bytes ...
// Or maybe, if was !completed, handle the expected exception.
I'm hoping that CF 1.1 supports that scenario...
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.
Have I helped? Consider visiting my Amazon wishlist, see my homepage.