问答详情
源自:3-4 完善用户登陆之服务器响应客户端

代码出现报错

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(Unknown Source)

at java.net.SocketInputStream.read(Unknown Source)

at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)

at sun.nio.cs.StreamDecoder.implRead(Unknown Source)

at sun.nio.cs.StreamDecoder.read(Unknown Source)

at java.io.InputStreamReader.read(Unknown Source)

at java.io.BufferedReader.fill(Unknown Source)

at java.io.BufferedReader.readLine(Unknown Source)

at java.io.BufferedReader.readLine(Unknown Source)

at Client.main(Client.java:25)

第25行的错误是这个:

while((info=br.readLine())!=null){

System.out.println("服务器来说:"+info);

}


提问者:qq_不知道叫什么好_0 2015-02-04 18:59

个回答

  • _潇潇暮雨
    2015-02-05 15:18:49

    是否建立了Socket连接?