5 Replies Latest reply: Feb 9, 2011 7:23 AM by aksarben RSS

    server shows disconnected but client shows still connected

    838065
      I have a java program, which act as a client. Sometimes server indicate disconnected but client still shows connected to the server. I need suggestions.
        • 1. Re: server shows disconnected but client shows still connected
          Kayaman
          835062 wrote:
          I have a java program, which act as a client. Sometimes server indicate disconnected but client still shows connected to the server. I need suggestions.
          Hmm...I would suggest finding the problem, then fixing it.
          Hope this helps!
          • 2. Re: server shows disconnected but client shows still connected
            838065
            is it necessary @ os registry level such as keepAliveTime/keepAliveInterval parameters
            • 3. Re: server shows disconnected but client shows still connected
              Kayaman
              835062 wrote:
              is it necessary @ os registry level such as keepAliveTime/keepAliveInterval parameters
              Sure thing!
              Whenever I encounter a problem with a Java program, the first thing I do is go through the operating system settings.
              If I can't find or break anything there, I go to the garage and work on my car.

              </sarcasm>

              If you want any serious help, you're going to need to explain your problem better. Your explanation of "server shows disconnected but client shows connected" is completely useless.
              • 4. Re: server shows disconnected but client shows still connected
                gimbal2
                and follow Kayaman's hidden hint: blame yourself before blaming the technology. You made a mistake, there is a bug in your code. Go hunt that down.
                • 5. Re: server shows disconnected but client shows still connected
                  aksarben
                  My first suspicion is that the server thinks the connection is closed because of lack of activity. If it thinks the connection's closed, it's certainly not going to send a message to the client saying "I can't talk to you any more." It will more than likely just silently close the socket. Since the client's not hearing anything from the server, it may assume everything is still OK & that the connection is open (a bad assumption).

                  The only way to keep the server & client on the same page, so to speak, would be to use some kind of keep-alives during periods of inactivity. Otherwise, one side or the other may conclude that silence means the connection is closed. How you implement this depends on what protocol (if any) you're using. If you're not using some standard protocol, you'll probably have invent one that both the server & client agree on.