Results 1 to 7 of 7

Thread: No error from QTNetwork if network goes off

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    4
    Thanked 140 Times in 132 Posts

    Default Re: No error from QTNetwork if network goes off

    Hi!

    I made some project in Qt which had to react on unpluging cable and what I noticed is that it is not OS independent. On Windows you get that windows cloud with "Network cable unplugged... " or something and you can get some event in application (because OS can provide it). I tested my application on Kubuntu and when i unplugged network cable there was no reaction. I used only tcp socket and server, so I don't know how much it's connected with your classes but maybe it can help you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No error from QTNetwork if network goes off

    Basically there is no reliable way of determining if the network is down. Pulling out a cable from the socket doesn't yet mean a particular connection has been broken. What if it is rerouted using a different interface?

  3. #3
    Join Date
    Nov 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: No error from QTNetwork if network goes off

    I am not using any other interfaces. There is only one interface exist.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No error from QTNetwork if network goes off

    What if the application is deployed in a different environment? With bluetooth network for instance? What if the signal comes back after a second? A TCP connection will still be valid, right? What if the wire is cut not between your computer and the next network device but further away - you won't notice that yet no more packets will reach their destinations... There is simply no reliable way to determine if a connection is broken or if it is simply delayed. The only thing we have is timers. You may consider a connection broken after some defined amount of time.

  5. #5
    Join Date
    Nov 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: No error from QTNetwork if network goes off

    Yes exactly. I am also using Ubuntu and the problem exists.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.