Results 1 to 3 of 3

Thread: QtcpSocket and ports being used

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    10
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QtcpSocket and ports being used

    Is there a way on Qt to look at the host and see which ports are being used and by whom?

    Would tcpSocket->listen() or udpSocket->bind() give me the information.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: QtcpSocket and ports being used

    You could parse the output of Netstat by using QProcess ?

  3. #3
    Join Date
    Jun 2010
    Location
    Pretoria, South Africa
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 7 Times in 7 Posts

    Default Re: QtcpSocket and ports being used

    listen() and bind() are members of the relevant xServer classes and not the xSocket classes.

    You can find out the local and foreign addresses and ports from QAbstractSocket::localHost(), QAbstractSocket::localPort(), QAbstractSocket:eerAddress() and QAbstractSocket:eerPort()

Similar Threads

  1. Finding available COM ports with QextSerialPort
    By Ferric in forum Qt Programming
    Replies: 7
    Last Post: 26th October 2010, 19:16
  2. multiple view ports
    By manmohan in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2009, 07:54
  3. network ports up/down
    By kemp in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:38
  4. ports blocking
    By babu198649 in forum General Programming
    Replies: 3
    Last Post: 4th August 2008, 15:51
  5. QExtSerialPort with com ports above com9
    By mightymark in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2006, 08:16

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.