Results 1 to 7 of 7

Thread: Problem With FD_CLOSE Event

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241

    Problem With FD_CLOSE Event

    is the FD_CLOSE msg sent only when a socket is closed remote or when you close the socket also? I am using the closesocket() function to close my socket and when I do it doesnt send the FD_CLOSE msg. And I dont think it is when the connection is closed remotely.

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Try shutdown(sckSocket,0x02);

    Also you might try catching the socket close event and force send a FD_CLOSE over the wire.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    what do u mean catch the close event?

    and what does shutdown() do? close the socket?

  4. #4
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Are you using MFC? or API?

    Did you use WSAAsyncSelect to setup a callback?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    Im using API, and I did use WSAAsyncSelect. I think I fixed the problem with the FD_CLOSE message, but now I cant seem to have the socket reconnect.

  6. #6
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    That might be casused by the socket on the "server" or "client" end still holding your port open. You need to make sure that the socket is clear/destroyed before reconnecting

    It would be more helpfull if I could see your code or project.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    thx. Actually I just fixed it.

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