Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to specfy the ip to connect the server



  • there are two devices as servers by network lines connecting to my computer, and their IPs are the same(192.168.2.1), the port also the same(8501). I set the local IP address 192.168.2.100 and 192.168.101 each of them. I create a tcpSocekt ,but I don't know how to bind the local IP . it seems the "setLocalAddress()" will work, , Could anybody help me to solve the problem?


  • Qt Champions 2019

    @aisha08 Two different devices in same network at the same time canNOT have same IP! Your devices are configured wrongly. Make sure they have different IPs.


Log in to reply