Results 1 to 4 of 4

Thread: server to client question

  1. #1

    Thread Starter
    Banned
    Join Date
    Jun 2022
    Posts
    149

    server to client question

    the server has a list of users.
    I run a loop through the user list and send a packet to check if the client is running.

    1:how do I check on the server side if the message was sent or failed to send?
    2: how will I know if that user client.exe is running?

    sometimes the server may have 1 or more users stuck and fail to close their socket because the client pc hanged/froze/ some pc bug and the client doesn't run most of the unload code from a certain form, I could be wrong but this is what am thinking.
    so this is why am trying to run a check at certain intervals to see if they are online or offline.

  2. #2
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,470

    Re: server to client question

    There are multiple things that can cause a connection to be lost, the most common of which is the computer going to sleep. The client should send a periodic "keep alive" signal. I use a single byte record. If the server does not receive that signal with the specified time period, it closes the connection.

    J.A. Coutts
    Last edited by couttsj; Aug 19th, 2022 at 01:34 AM.

  3. #3

    Thread Starter
    Banned
    Join Date
    Jun 2022
    Posts
    149

    Re: server to client question

    Quote Originally Posted by couttsj View Post
    There are multiple things that can cause a connection to be lost, the most common of which is the computer going to sleep. The client should send a periodic "keep alive" signal. I use a single byte record. If the server does not receive that signal with the specified time period, it closes the connection.

    J.A. Coutts
    Can you share examples of bytes you send and server side checking code

  4. #4
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,470

    Re: server to client question

    Quote Originally Posted by jenniger9 View Post
    Can you share examples of bytes you send and server side checking code
    See
    https://www.vbforums.com/showthread....cure-Messaging
    for example.

    J.A. Coutts

Posting Permissions

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



Click Here to Expand Forum to Full Width