前言:这两个异常报出的时候,说明客户端没法正常连接到服务端,但是两者还是有区别的。 1:connection timed out
在实际开发中经常会碰到connection timed out的问题
java.net.connectexception: connection timed out (connection timed out)
at java.net.plainsocketimpl.socketconnect(native method)
at java.net.abstractplainsocketimpl.doconnect(abstractplainsocketimpl.java:350)
at java.net.abstractplainsocketimpl.connecttoaddress(abstractplainsocketimpl.java:206)
at java.net.abstractplainsocketimpl.connect(abstractplainsocketimpl.java:188)
at java.net.sockssocketimpl.connect(sockssocketimpl.java:392)
at java.net.socket.connect(socket.java:589)
at java.net.socket.connect(socket.java:538)
at java.net.socket.<init>(socket.java:434)
at java.net.socket.<init>(socket.java:211)
at clientsockettimeout.main(clientsockettimeout.java:8)