Results 1 to 3 of 3

Thread: network ports up/down

  1. #1
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default network ports up/down

    Hi!

    my application has to check on the local machne if an UDP port is up or down.

    How can i get the status of an UDP port?

  2. #2
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: network ports up/down

    I have tried this with
    Qt Code:
    1. QUdpSocket udpSocket;
    2. if(udpSocket.bind(address,port))
    3. {
    4. return PORT_UP;
    5. }
    6. else
    7. {
    8. return PORT_DOWN;
    9. }
    To copy to clipboard, switch view to plain text mode 
    but i don't know if this is the right solution for the problem.

  3. #3
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: network ports up/down

    solved with

    QAbstractSocket::connectToHost

    and

    QAbstractSocket::SocketState

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.