Results 1 to 3 of 3

Thread: Getting informed about newly connected network adapters

  1. #1
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Getting informed about newly connected network adapters

    Hi all,

    I have an app which at startup looks for available network adapters, creates a UDP socket for each one and sends UDP identification broadcasts to all found nets to scan for certain devices.
    All works fine, except when a new adapter is available (e.g. someone plugs in the network cable) the list is not updated.
    Of course, I can retrieve the new adapter list all 10 seconds using a timer and refresh the UDP sockets but it would be more elegant to have interrupt instead of poling and being notified of a new adapter.
    Is there such a thing as a signal which informs about new or removed adapters?

    At least, I didn't find it.

    Best regards,

    Rainer

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

    Default Re: Getting informed about newly connected network adapters

    No, Qt has no facilities for that. You need to intercept a native event using QApplication::winEventFilter() or QWidget::winEvent() and handle it there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    RThaden (19th January 2010)

  4. #3
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Getting informed about newly connected network adapters

    Thanks Wysota. After some reading and searching I found an article about catching WMI events.
    For anyone who is interested (Win32 specific):
    http://www.codeproject.com/KB/system/UsingWMI.aspx

    Best regards,

    Rainer

Similar Threads

  1. Is internet connected
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2009, 21:22
  2. Disconnect slot when another is being connected
    By holst in forum Qt Programming
    Replies: 4
    Last Post: 8th September 2009, 09:49
  3. Connected client tree
    By cooler123 in forum Qt Programming
    Replies: 7
    Last Post: 13th July 2009, 20:49
  4. The application with connected units.
    By kuzulis in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 23:54
  5. how can i know how many slots connected to a signal?
    By yj_yulin in forum Qt Programming
    Replies: 6
    Last Post: 1st December 2008, 10:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.