Tag: serversocket

java.net.SocketException:无效的参数:connect

我的新笔记本电脑(Alienware m17x)抛出一个java.net.SocketException: Invalid argument: connect当我运行以下基本代码时java.net.SocketException: Invalid argument: connect : Server.java: public static void main (String[] args) throws Exception { ServerSocket serverSocket = new ServerSocket (8888); Socket socket = serverSocket.accept(); } Client.java: public static void main (String[] args) throws Exception { Socket socket = new Socket (“localhost”, 8888); } 每次我运行Client.java(在启动Server.java之后),我都会收到此套接字exception。 以下是exception的完整描述: Exception in thread “main” java.net.SocketException: […]