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. IOCP Socket Timeout Problem..

IOCP Socket Timeout Problem..

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelpquestion
3 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.
  • O Offline
    O Offline
    onlyjaypatel
    wrote on last edited by
    #1

    We have developed one IOCP server Application. We got a socket close event when client application (safe/unsafe) close. But when client machine restarts or network cable unplugged we can not get any event of the socket close. We have also tried to set socket timeout with setsockopt() ,but its not working with IOCP. So ,Is there any method to get close event for this sockets? or any other method to set timeout in IOCP. Thank you.

    M C 2 Replies Last reply
    0
    • O onlyjaypatel

      We have developed one IOCP server Application. We got a socket close event when client application (safe/unsafe) close. But when client machine restarts or network cable unplugged we can not get any event of the socket close. We have also tried to set socket timeout with setsockopt() ,but its not working with IOCP. So ,Is there any method to get close event for this sockets? or any other method to set timeout in IOCP. Thank you.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      What is an "IOCP server Application"? Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • O onlyjaypatel

        We have developed one IOCP server Application. We got a socket close event when client application (safe/unsafe) close. But when client machine restarts or network cable unplugged we can not get any event of the socket close. We have also tried to set socket timeout with setsockopt() ,but its not working with IOCP. So ,Is there any method to get close event for this sockets? or any other method to set timeout in IOCP. Thank you.

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

        No, IP is not a 'connected' protocol, it just maintains connection state on each side. This is usually considered a feature as it allows recovery from temporary disconnects. A common solution is to add a heart-beat message to your protocol that the server sends to the client. The heart-beat message basically says 'hey, are your still there? if so please respond to this'. If the client doesn't respond in a timely manner it is assumed that the connection is broken. See: http://tangentsoft.net/wskfaq/newbie.html#abnormalclose[^]

        ...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack

        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