Results 1 to 2 of 2

Thread: How to determine ip address of remote host?

  1. #1
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to determine ip address of remote host?

    Hi Folks,

    is there a way to determine the ip address of a remote host by the socket descriptor passed to QTcpServer::incomingConnection()?
    I would like to accept only connections from trusted ip addresses.
    Please let me know if you have any ideas how this can be done.
    Thanks in advance,
    nop nop nop....

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to determine ip address of remote host?

    If you have QTcpSocket you can use the peerAddress() method. With a descriptor you might try POSIX getpeername() function.

Similar Threads

  1. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 23:14

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.