Dear marcF
My teacher tell me in the .net framework2.0
If I use AutoResetEvent like this:
AutoResetEvent returnWaitSignal=new AutoResetEvent();
if (!returnWaitSignal.WaitOne(returnPacketTimeOutMilliSeconds))
{
RemoveIncomingPacketHandler(expectedReturnPacketTypeStr, SendReceiveDelegate);
throw new ExpectedReturnTimeoutException("Timeout occurred after " + returnPacketTimeOutMilliSeconds.ToString() + "ms waiting for response packet of type '" + expectedReturnPacketTypeStr + "'.");
}
should change the code to:
AutoResetEvent returnWaitSignal=new AutoResetEvent();
if (!returnWaitSignal.WaitOne(returnPacketTimeOutMilliSeconds,true))
{
RemoveIncomingPacketHandler(expectedReturnPacketTypeStr, SendReceiveDelegate);
throw new ExpectedReturnTimeoutException("Timeout occurred after " + returnPacketTimeOutMilliSeconds.ToString() + "ms waiting for response packet of type '" + expectedReturnPacketTypeStr + "'.");
}
because in .net framework 2.0 the waitone method has some problem when use only one paramter
I test it in my computer .the System is window 2003
-
This topic was modified 10 years, 7 months ago by . Reason: Edited to add code tags