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. CSocket: in which cases that server receives OnClose() event?

CSocket: in which cases that server receives OnClose() event?

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestion
2 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.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    As I tested, in the 3 cases, server receives OnClose() event: 1. client calls Close() 2. client exits app - Close() should be called in client destructor. 3. server send string to client after Close() was called by client. Are there other cases that server receives OnClose() event? E.g. (from google) if internet unplugged on client side, server doen't receive OnCloe() - I use local IP address, so I can't test the case. .

    V 1 Reply Last reply
    0
    • I includeh10

      As I tested, in the 3 cases, server receives OnClose() event: 1. client calls Close() 2. client exits app - Close() should be called in client destructor. 3. server send string to client after Close() was called by client. Are there other cases that server receives OnClose() event? E.g. (from google) if internet unplugged on client side, server doen't receive OnCloe() - I use local IP address, so I can't test the case. .

      V Offline
      V Offline
      varunpandeyengg
      wrote on last edited by
      #2

      Basically OnClose() event is recieved to notify that the connected socket is closed by its process. It can happen due to following: - 1) Network subsystem failed 2) Connection was reset by the remote side 3) Connection was aborted due to timeout or other failure. Try to fit your test cases here... CHEERS!!!

      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