简体   繁体   English

BufferedReader.readLine()给出错误java.net.SocketException:软件导致连接中止:recv失败

[英]BufferedReader.readLine() gives error java.net.SocketException: Software caused connection abort: recv failed

I am trying to code my program so that the buffered reader gets something in readLine() from my tcp client but I get this error as soon as the program executes 我正在尝试对程序进行编码,以使缓冲的读取器从tcp客户端获取readLine()中的内容,但程序执行后立即出现此错误

   Mar 31, 2010 11:03:36 PM deswash.DESWashView$5 run
SEVERE: null
java.net.SocketException: Software caused connection abort: recv failed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at deswash.DESWashView$5.run(DESWashView.java:448)

the car=in.readLine() in the following code throws the error 以下代码中的car = in.readLine()引发错误

 public void getCar(){
        Thread gettingCars = new Thread(){
            @Override
            public void run(){
                try {
                    car = in.readLine();
                    if(!(car.equals(null))){
                        StringTokenizer st = new StringTokenizer(car,";");
                        int carTime = Integer.parseInt(st.nextToken());
                        finTime.setText(""+((Integer.parseInt(currentTime.getText()))+washTime));
                        currentTime.setText(""+carTime);
                        eventTextArea.append(""+car+"\n");
                    }
                } catch (IOException ex) {
                    Logger.getLogger(DESWashView.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        };
        gettingCars.start();
        doOnce=false;
    }

From MSDN: 从MSDN:

WSAECONNABORTED (10053) Software caused connection abort WSAECONNABORTED (10053)软件导致连接中止

A connection abort was caused internal to your host machine. 连接中断是由主机内部引起的。 The software caused a connection abort because there is no space on the socket's queue and the socket cannot receive further connections. 该软件导致连接中止,因为套接字队列中没有空间,并且套接字无法接收进一步的连接。

WinSock description: The error can occur when the local network system aborts a connection. WinSock描述:当本地网络系统中止连接时,可能会发生错误。 This would occur if WinSock aborts an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket). 如果WinSock在数据重传失败后中止建立的连接(接收方从不确认在数据流套接字上发送的数据),则会发生这种情况。

TCP/IP scenario: A connection will timeout if the local system doesn't receive an (ACK)nowledgement for data sent. TCP / IP方案:如果本地系统未收到发送数据的(ACK)提示,则连接将超时。 It would also timeout if a (FIN)ish TCP packet is not ACK'd (and even if the FIN is ACK'd, it will eventually timeout if a FIN is not returned). 如果未确认(FIN)的TCP数据包也将超时(即使FIN已被ACK,如果未返回FIN,它最终也会超时)。

It seems to happen more with WindowsXP and it seems also to be possibly related to Windows firewall settings. WindowsXP似乎更多地发生了这种情况,这似乎也可能与Windows防火墙设置有关。 In any case the salient point is that the abort has originated inside the local machine. 在任何情况下,重点都在于中止源于本地计算机内部。

It's a stupidly worded message. 这是一个措辞愚蠢的消息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.net.SocketException:软件导致连接中止:Java 8 recv失败 - java.net.SocketException: Software caused connection abort: recv failed with Java 8 java.net.SocketException:软件导致连接中止:recv失败; 原因和治疗方法? - java.net.SocketException: Software caused connection abort: recv failed; Causes and cures? java.net.SocketException:软件导致连接中止:使用其他jre安全性时recv失败 - java.net.SocketException: Software caused connection abort: recv failed when using different jre security JnrpeClient:java.net.SocketException:软件导致连接中止:recv失败 - JnrpeClient : java.net.SocketException: Software caused connection abort: recv failed java.net.SocketException:软件导致连接中止:重新提交请求时套接字写入错误 - java.net.SocketException: Software caused connection abort: socket write error when resubmitting the request 通过串行端口java.net.SocketException的通信:软件导致连接中止:套接字写入错误 - Communication through serial port, java.net.SocketException: Software caused connection abort: socket write error 在FTP中存储ObjectOutputStream导致java.net.SocketException:软件导致连接中止:套接字写入错误 - Store ObjectOutputStream in FTP causes java.net.SocketException: Software caused connection abort: socket write error Java错误 - 软件导致连接中止:recv失败 - Java error - Software caused connection abort: recv failed 软件导致连接中止:recv失败 - Software caused connection abort: recv failed “软件导致连接中止:接收失败”的原因 - Cause of “Software caused connection abort: recv failed”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM