Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- From: Keith Langer <tanalbit@xxxxxxx>
- Date: Wed, 01 Aug 2007 00:02:58 -0000
On Jul 31, 5:49 pm, Peter Duniho <NpOeStPe...@xxxxxxxxxxxxxxxx> wrote:
Keith Langer wrote:
Hi,
I've noticed that the behavior of ReceiveTimeout has changed
between .Net 1.1 and .Net 2.0 when it comes to the GetStream.Read
method. In .Net 1.1, if the timeout period elapsed, I would get a
System.IO.IOException, but the connection stayed open. I could then
check the InnerException for Errorcode 10060 to verify that it was a
timeout. In .Net 2.0, I still get an IOException when there's a
timeout, but this time the socket closes. This means I would have to
reestablish the connection when I didn't need to before
Actually, you should have been reestablishing the connection before as
well. It's just that .NET didn't force you to, even though doing so was
important to maintain data integrity.
See this previous thread, discussing this exact issue:http://groups.google.com/group/microsoft.public.dotnet.framework/brow...
Pete
Pete,
Can you explain this indeterminate state? I have always been able to
reuse the connection without any problems in 1.1. Now if I have a
series of serial devices I'm polling, for every serial timeout, I have
to add a few more seconds to reestablish the tcp connection. This is
going to slow things down quite a bit. Plus, in cases where someone
else makes the connection, I'm forcing them to reconnect.
Keith
.
- Follow-Ups:
- References:
- GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- From: Keith Langer
- Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- From: Peter Duniho
- GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- Prev by Date: ASP 3.0 not releasing objects to pool (Windows 2003 Server)
- Next by Date: Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- Previous by thread: Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- Next by thread: Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
- Index(es):
Relevant Pages
|
Loading