Unexpected server disconnect issue

  • Christian Schulte


    I am using java-0.3.8 rtk and had quite a strange situation yesterday for the first time. The client runs since months without any problems but this one here occured yesterday:

    I did a transfer-request but got a "Unexpected server disconnect" exception. My client is programmed in a way that if it receives this exeption it simply reconnects and issues the same request for which the unexpected server disconnect exception got thrown again. The problem now is, that the first request got sent to the server and only reading the response failed. So the transfer got started the first time and re-issueing the transfer request produced an eppException "Object pending transfer"! This leads to setting the status of the ticket which started the transfer to failed and not to successfull! I now looked at the source of EPPClient and tried to find out if there is any possibility to check if a request for which an "unexpected server disconnect" exception is "received" was successfully sent but cannot find a solution. The "unexpected server disconnect" exception only gets thrown in the readFromServer-method! writeToServer would throw an "Failed to write to server" exception if an IOException gets thrown during flushing the output buffer but I never saw such exception and actually the java socket-api implementation does only sent the outputbuffer if starting to read a response I think. So the "failed to write to server" exception will never get thrown because no IOException will ever get thrown during writing to server I think! The only exception I get is "unexpected server disconnect" and one cannot rely on the request having been sent successfully or not ! Is there any solution on chechking for a request having been sent successfully if only receiving fails ?


    • Christian Schulte

      Finally I am not able to force an failed-to-write-to-server-exception. I tried several times to shut down the interface before writing to the server and wanted to find out if I get an exeption in writeToServer but I never managed to get that! I only get this exception and never a failed-to-write-to-server-exception!

      org.openrtk.idl.epp.epp_Exception: { m_details [[org.openrtk.idl.epp.epp_Result: { m_code [2600] m_msg [Failed to read from server [class java.io.InterruptedIOException] [Read timed out]] m_lang [null] m_id [null] m_values [null] }]] }

      I am a bit stuck in java's socket-api implementation right now. It really seems that java is sending the outputbuffer not on flushing it but on trying to read from the socket afterwards! If I flush the outputbuffer this will not throw any exception althought the interface is down! I only get the failed-to-read-from-server-exception if trying to read from the socket and have no status about the sending before! What can I do ?

      • Daniel Manley

        Daniel Manley - 2003-01-31

        sorry for the late reply on this -- new job and new responsibilities.

        It looks like you've already been deeper into the Java socket implementation that I have ever been.  A possible work-around to this situation (which you might have already implemented) is to included error handling in your transfer submission logic to do a transfer query if the transfer request fails with the read error.  Not terribly sofisticated, but it should cover it.

        Dan Manley


Log in to post a comment.