It is interesting why Java_java_net_DualStackPlainSocketImpl_waitForConnect uses t.tv_usec = (timeout % 1000) * 1000; for microseconds. For example if timeout is 60000 milliseconds then t.tv_sec = 60 seconds but t.tv_usec = 0 microseconds, and it I set the timeout to a number not multiple of 1000, like 59325 milliseconds, then t.tv_sec = 59 and t.tv_usec = 325000 microseconds.
Either way "waitForConnect" method from DualStackPlainSocketImpl java class is not waiting for the set timeout, so something looks really wrong here (at least on Windows OS).
It is interesting why Java_java_net_DualStackPlainSocketImpl_waitForConnect uses
t.tv_usec = (timeout % 1000) * 1000;
for microseconds. For example if timeout is 60000 milliseconds then t.tv_sec = 60 seconds but t.tv_usec = 0 microseconds, and it I set the timeout to a number not multiple of 1000, like 59325 milliseconds, then t.tv_sec = 59 and t.tv_usec = 325000 microseconds. Either way "waitForConnect" method from DualStackPlainSocketImpl java class is not waiting for the set timeout, so something looks really wrong here (at least on Windows OS).