日期:2014-05-20 浏览次数:20785 次
ServerSocket serverSocket = new ServerSocket(8000);
Socket socket = serverSocket.accept();
InputStream is = socket.getInputStream();
//接收输入流操作
is.close();
OutputStream os = socket.getOutputStream();
//输出返回值os.write();
os.close();
socket.close();
ServerSocket serverSocket = new ServerSocket(8000);
Socket socket = serverSocket.accept();
InputStream is = socket.getInputStream();
//接收输入流操作
OutputStream os = socket.getOutputStream();
//输出返回值os.write();
is.close();
os.close();
socket.close();
ServerSocket serverSocket = new ServerSocket(8000);
Socket socket = serverSocket.accept();
InputStream is = socket.getInputStream();
is.close();
System.out.println(socket.isClosed());