Nominate our 2022 Qt Champions!

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(, the port also the same(8501). I set the local IP address 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?

  • Lifetime Qt Champion

    @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