Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to track that Cleint or Server is disconneted

How to track that Cleint or Server is disconneted

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestiontutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zahid_ash
    wrote on last edited by
    #1

    HI, I have a network application one is client and other is server running on internet , How can I come to know the one of them is get disconnect (or due to disconnection of internet one application is not listeinign or replying) How can I implement this? Regards.

    E 1 Reply Last reply
    0
    • Z zahid_ash

      HI, I have a network application one is client and other is server running on internet , How can I come to know the one of them is get disconnect (or due to disconnection of internet one application is not listeinign or replying) How can I implement this? Regards.

      E Offline
      E Offline
      Eytukan
      wrote on last edited by
      #2

      If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.


      --[V]--

      [My Current Status]

      Z T 2 Replies Last reply
      0
      • E Eytukan

        If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.


        --[V]--

        [My Current Status]

        Z Offline
        Z Offline
        zahid_ash
        wrote on last edited by
        #3

        Where I will get this exception, How and where can I handle this one Regards.

        E 1 Reply Last reply
        0
        • Z zahid_ash

          Where I will get this exception, How and where can I handle this one Regards.

          E Offline
          E Offline
          Eytukan
          wrote on last edited by
          #4

          Tell me how do you get data from the server? If possible, post the code. (may be inside the thread, if you've created one)make a try{} catch{} on the code block where you receive data from client. if, the server gets disconnected, it'll enter into the catch block.


          --[V]--

          [My Current Status]

          1 Reply Last reply
          0
          • E Eytukan

            If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.


            --[V]--

            [My Current Status]

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            VuNic wrote:

            You have to sense it on your own, may be with something like "Heart beat" sensing.

            Humm Heart Beat... my heart beat for...... :)

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

            E 1 Reply Last reply
            0
            • T ThatsAlok

              VuNic wrote:

              You have to sense it on your own, may be with something like "Heart beat" sensing.

              Humm Heart Beat... my heart beat for...... :)

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

              E Offline
              E Offline
              Eytukan
              wrote on last edited by
              #6

              To sense it, you need a *lady* client!!


              --[V]--

              [My Current Status]

              T 1 Reply Last reply
              0
              • E Eytukan

                To sense it, you need a *lady* client!!


                --[V]--

                [My Current Status]

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                VuNic wrote:

                To sense it, you need a *lady* client!!

                I don't have ONe:((

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups