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. Crashes

Crashes

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 2 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.
  • D Offline
    D Offline
    dellthinker
    wrote on last edited by
    #1

    Hi all. I have a TCP program that crashes when a connection isnt made. One example is when i open it and dont allow the connection through a firewall it crashes in Windows. How would i go about making it try to reconnect every so often if a connection isnt established without crashing? Thanx in advance!

    H 1 Reply Last reply
    0
    • D dellthinker

      Hi all. I have a TCP program that crashes when a connection isnt made. One example is when i open it and dont allow the connection through a firewall it crashes in Windows. How would i go about making it try to reconnect every so often if a connection isnt established without crashing? Thanx in advance!

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      dellthinker wrote:

      How would i go about making it try to reconnect every so often if a connection isnt established without crashing?

      Probably the first step is to use the debugger to determine exactly why it is crashing. When it crashes, look at the call stack window, see how it got there, inspect the variables.

      Best wishes, Hans


      [CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]

      D 1 Reply Last reply
      0
      • H Hans Dietrich

        dellthinker wrote:

        How would i go about making it try to reconnect every so often if a connection isnt established without crashing?

        Probably the first step is to use the debugger to determine exactly why it is crashing. When it crashes, look at the call stack window, see how it got there, inspect the variables.

        Best wishes, Hans


        [CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]

        D Offline
        D Offline
        dellthinker
        wrote on last edited by
        #3

        I ran the debugger and it pointed at this line: structSock.sin_addr.s_addr = *((unsigned long*)ServerAddr->h_addr_list[0]); Do i need to loop this every so often to make sure the program doesnt crash when trying to connect? This was the error message that VC++ gave me. Unhandled exception in Program.exe: 0xC0000005: Access Violation. P.S. I set a breakpoint at that line and yes it is the problem. How can i resolve this? Anyone care to shed some light on what that means?

        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