Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post server shows disconnected but client shows still connected

    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.

  • #2
    New Coder
    Join Date
    Feb 2011
    Posts
    48
    Thanks
    1
    Thanked 2 Times in 2 Posts
    The problem mentioned by you is too general. Please provide me some more information, help me to help you.

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a java program. It is used for transfer text. It is running smoothly most of the time. But my problem is that, sometimes the connection lost between server and client. At that time the server shows client is not connected but client shows connected with server.

  • #4
    New Coder
    Join Date
    Jan 2011
    Location
    India
    Posts
    31
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Unless you put your code how someone can understand the problem?
    Put your code, someone will try to help you out

  • #5
    New Coder
    Join Date
    Feb 2011
    Posts
    48
    Thanks
    1
    Thanked 2 Times in 2 Posts
    OK, so, you should set a timeout to your streams and to catch exceptions. If you're saving the last message at the server and the client, both can determine whether your message was sent well. If your sending or messaging times out, resend the data at the sender and try again to receive the message at the receiver. You should use a timeout counter and whenever you succeed in sending/receiving a message, set the counter to 0 and whenever a timeout happens, increase your counter. If your counter reaches a number your connection is unusable and you should recreate your connection.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •