1 2 Previous Next 18 Replies Latest reply: Feb 9, 2012 12:36 AM by 911421 Go to original post RSS
      • 15. Re: ObjectInputStream.readObject() hangs forever during socket communication
        EJP
        If the connection is closed, why the no other exceptions are detected to notify the application.
        Because this is the exception to notify the application. TCP doesn't provide anything else, unless the firewall sends a FIN in both directions, which I doubt it would do. So nothing will happen at all until an RST is provoked by I/O at either peer.

        EDIT: unless you come up with a firewall explanation, I am thinking this must be (a) a read timeout and (b) a kernel bug that misreports it as a connection timeout. It would be useful if you could construct a simple test case, without SSL or Object streams, that just reads from a connection, with timeout, where nothing is ever written, and see if you get the same exception.
        • 16. Re: ObjectInputStream.readObject() hangs forever during socket communication
          911421
          Hello, EJP, Recently, i use the tcpdump to capture the message flows, then I observed that the after the ObjectOutputStream.writeObject() was invoked, in the tcp level, the tcp has retransmission-ed about 9 times,like below:
          NO. Time Source Destination Protocol Info
          14845 2012-02-07 22:37:46 10.* 10.* DNP 3. len=1,from 52156 to 29466,ACK
          14846 2012-02-07 22:37:46 10.* 10.* DNP 3. len=1,from 54562 to 50276,ACK
          14848 2012-02-07 22:37:46 10.* 10.* DNP 3. [TCP Restransmission] len=1,from from 52156 to 29466,ACK
          ……(7 times retransmission)
          14849 2012-02-07 22:37:46 10.* 10.* DNP 3. [TCP Restransmission] len=1,from from 52156 to 29466,ACK
          • 17. Re: ObjectInputStream.readObject() hangs forever during socket communication
            EJP
            14845 2012-02-07 22:37:46 10.* 10.* DNP 3. len=1,from 52156 to 29466,ACK
            14848 2012-02-07 22:37:46 10.* 10.* DNP 3. [TCP Restransmission] len=1,from from 52156 to 29466,ACK
            It seems to be retransmitting an ACK for some reason. I think at this point you should take it to news:comp.protocols.tcp-ip, with the complete tcpdump.
            • 18. Re: ObjectInputStream.readObject() hangs forever during socket communication
              911421
              HI, EJP, thanks very much for your support. i have solved this problem by adding a function that periodically sends testing messages from server to pilot to keep the connection alive or be in traffic. then no exceptions could be found.

              although i dont know why this happens.
              1 2 Previous Next