Results 1 to 2 of 2

Thread: Help! Winsock API... The damn FD_CLOSE

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Jonquière, Qc, Canada
    Posts
    15

    Angry Help! Winsock API... The damn FD_CLOSE

    Is there a way to determine if an asynchronous socket is sending data or not? I got a problem closing socket on my server/client application, the way it's built... Does anyone can give me an example of a graceful disconnect? I know it's something like:
    1.Finish sending data.
    2.Call shutdown() with the how parameter set to 1.
    3.Loop on recv() until it returns 0.
    4.Call closesocket().
    But how can i tell that my socket is finish sending data? Please help, I'm bored!
    - Allied

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    I just use shutdown(socket, SD_BOTH) and then closesocket(socket)
    By the way:
    Code:
    Const SD_BOTH = 3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width