I assume that the socket is looking at hasPendingConnections(), and waits the timeout period only if there are pending connections, if not, there is no need to wait, and it returns immidietly.
This is only a guess.

And plese use the code tags for code.