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. Socket (client) crashes program one one computer when the other computer (server) powers down - Strange

Socket (client) crashes program one one computer when the other computer (server) powers down - Strange

Scheduled Pinned Locked Moved C / C++ / MFC
questionsysadmin
5 Posts 5 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.
  • S Offline
    S Offline
    Stan the man
    wrote on last edited by
    #1

    Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man

    L C J A 4 Replies Last reply
    0
    • S Stan the man

      Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Stan the man wrote:

      Is there something that I need to do

      The first thing I would do is to try some debugging to find out what is causing the crash; and what sort of crash it is. Is it a bug in the client code, something in the system libraries etc? Without that information it's not easy to suggest how to fix it.

      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

      1 Reply Last reply
      0
      • S Stan the man

        Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        Code Watson, we need code. :)

        Veni, vidi, vici.

        1 Reply Last reply
        0
        • S Stan the man

          Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          How long does it take to crash? As a wild guess...something to do with Active Directory and DNS resolution. Of the scenarios you listed I would suspect that on shutdown AD is told about the server shutdown. Where in the other cases AD doesn't know about it. Consequently AD fails for the one case where in the others connectivity failures are the result.

          Stan the man wrote:

          the client program will crash when trying to connect (it will try to connect to a server every 3 seconds)

          That is a very small retry window. Presumably you are correctly cleaning up after each of those attempts.

          1 Reply Last reply
          0
          • S Stan the man

            Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            For debug purposes... did you try to extend the retry (longer than 3 seconds)? Did you make sure the last attempt was finished, failed, and was cleaned up before you attempted to connect again? 3 seconds may not be enough time for the initial attempt to timeout... something to consider.

            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