It appears that Socket.Select in fx2.0 has a bug in Select logic and/or the
documentation is wrong. Passing (-1) should be a timeout infinite as
documented. However passing -1 does not block as it should. After looking
at the code, it seems that anything that is not -1 gets converted to a
respective TimeValue. However anything else, including -1, gets the default
TimeValue of all zeros - same as passing 0. Is this a bug or a design
choice?
public static void Select(IList checkRead, IList checkWrite, IList
checkError, int microSeconds)
{
//...
TimeValue value1 = new TimeValue();
if (microSeconds != -1)
{
Socket.MicrosecondsToTimeValue((long) ((ulong) microSeconds),
ref value1);
}
int num1 = UnsafeNclNativeMethods.OSSOCK.select(0, ptrArray1,
ptrArray2, ptrArray3, ref value1);
//...
}
--
William Stacey [MVP]