JAVA 阻塞网络编程基本步骤
1. 客户端
//客户端基本步骤 Socket socket= new Socket("127.0.0.1",80); socket.getOutputStream(); socket.close();
2. 服务端
//服务端基本步骤 ServerSocket ssocket =new ServerSocket(80); Socket socket1 =ssocket.accept(); socket1.getInputStream(); socket1.close(); ssocket.close();