AdoptOpenJDK / openjdk-jdk8u

JDK8u mirror from mercurial
http://hg.openjdk.java.net/jdk8u/jdk8u/
GNU General Public License v2.0
373 stars 286 forks source link

why Java_java_net_DualStackPlainSocketImpl_waitForConnect uses t.tv_usec = (timeout % 1000) * 1000; #11

Closed blassmegod closed 4 years ago

blassmegod commented 4 years ago

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).

karianna commented 4 years ago

@blassmegod please raise this in the upstream mailing list https://mail.openjdk.java.net/mailman/listinfo/jdk8u-dev