C
carmelo8
Hi there,
I want to timeout Read method of System.Stream class after 30 secs. of
no activity given a certain opened connection. That is, because some
incoming connections to my application just don't give any signal and
my Read method keeps waiting from the socket for some data to be read
eternally.
I have seen that in framework 2.0 System.Stream.Read has a new property
that will probably match with what I need called 'ReadTimeout'. But i
was wondering how to do that in framework 1.1 that do not has this one.
I have tried to do that with System.Timers.Timer class throwing an
event after 30secs. that create a thread to do some action but i don't
actually need a new thread i just want to timeout an operation (Read)
and after a certain time unblock it and be able to fire some exception
or just handle the "non response from the established connection"
scenario.
If anyone can help me with that or know how to solve it I'll be really
glad. Thanks in advanced.
Carmelo
I want to timeout Read method of System.Stream class after 30 secs. of
no activity given a certain opened connection. That is, because some
incoming connections to my application just don't give any signal and
my Read method keeps waiting from the socket for some data to be read
eternally.
I have seen that in framework 2.0 System.Stream.Read has a new property
that will probably match with what I need called 'ReadTimeout'. But i
was wondering how to do that in framework 1.1 that do not has this one.
I have tried to do that with System.Timers.Timer class throwing an
event after 30secs. that create a thread to do some action but i don't
actually need a new thread i just want to timeout an operation (Read)
and after a certain time unblock it and be able to fire some exception
or just handle the "non response from the established connection"
scenario.
If anyone can help me with that or know how to solve it I'll be really
glad. Thanks in advanced.
Carmelo