Java套接字java.io.EOFException

时间:2016-04-11 08:54:07

标签: java sockets

在线程" main"中获取异常java.io.EOFException的

在最后一行代码中,为什么?以及如何解决...谢谢。

String ip = "XXX.XX.XX.XXX";
    int port = XXXXX;
    Socket socket = null;
    System.out.println("in function");
    socket = new Socket(ip, port);
    System.out.println("in function - After Socket");
    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
    System.out.println("in function - After ObjectOutputStream");
    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());

0 个答案:

没有答案