Hi Tan,
Setting the connection property socketTimeout=[milliseconds] limits the maximum time that each operation is allowed to wait on the socket.
DriverManager.setLoginTimeout([seconds]) limits the aproximate time the driver is allowed to wait for a successful authentication. Note that this feature is implemented on top of sockets timeout support.
Different operating systems with unusual network configurations may deliver different results since this features depend entirely on how sockets are implemented on the OS.
I would recommend you to try running your client application with different operating systems. If nothing helps, maybe try to implement a simple client to establish a network connection, using a default socket, to your MySQL server and explore different socket timeout settings.
If you find some bad behavior, please report it in
http://bugs.mysql.com/. Thanks.