MS:永远吧
Java代码
connect
publicvoidconnect(SocketAddress endpoint,
inttimeout)
throwsIOException
Connectsthissocket to the server with a specified timeout value.
A timeout of zero is interpreted as an infinite timeout.
The connection will then block until established or an error occurs.
Parameters:
endpoint - the SocketAddress
timeout - the timeout value to be used in milliseconds.