CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15
  1. #1
    Join Date
    Jul 2008
    Posts
    8

    Receive MEssage When the Connection get Dissconnected

    hi
    how can i Receive Message when the each connection get disconnected?

  2. #2
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: Receive MEssage When the Connection get Dissconnected

    I'm not exactly sure what you mean, but calls to send() or recv() will return '0' as soon as the connection is gone.

  3. #3
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    am using IPAddress::Any when each connection is lost or disconnected I dont receive any Messages from ???????

  4. #4
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: Receive MEssage When the Connection get Dissconnected

    That is correct. When the connection is gone you'll stop receiving things on it.

  5. #5
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    so what should i do
    how to get message when i a connection get dissconected

  6. #6
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: Receive MEssage When the Connection get Dissconnected

    I'm not sure - in what way is my answer in post #2 not suitable for you?

  7. #7
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    is there callback function Connection?

  8. #8
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    Re: Receive MEssage When the Connection get Dissconnected

    you need to implement your own handshake messages or you can try to use KEEP_ALIVE messages. The latter must be turned on via setsockopt.

  9. #9
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    KEEP_ALIVE is for tcp .
    does not work with UDP

  10. #10
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    Re: Receive MEssage When the Connection get Dissconnected

    you did not mention you are working with UDP. UDP has no notion of a 'connection', so it can not be disconnected.

    If you could describe your problem in detail, maybe we could help you better?

  11. #11
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    the udp is in Receive Mode then the netwok card disconnects.
    now i want to get a notification.

  12. #12
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    Re: Receive MEssage When the Connection get Dissconnected

    OK, I quit.

  13. #13
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Receive MEssage When the Connection get Dissconnected

    Quote Originally Posted by jan_Zoser2005
    the udp is in Receive Mode then the netwok card disconnects.
    now i want to get a notification.
    I haven't done a lot of network programming, but I don't think this is possible. I'm assuming you're talking about the "client network card" (with your program running on the server).

    As was said, UDP is connectionless. Therefore there is no disconnect.

    Viggy

  14. #14
    Join Date
    Jul 2008
    Posts
    8

    Re: Receive MEssage When the Connection get Dissconnected

    As I said I want to know when the Network Card is disconnected... Not a connection!!!

  15. #15
    Join Date
    May 2008
    Posts
    300

    Re: Receive MEssage When the Connection get Dissconnected

    See RegisterDeviceNotification

    It works as I recall.
    Nope

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

Featured