QTcpClient successfully connects, but not to my server. Where is it connecting?

后端 未结 3 1526
小鲜肉
小鲜肉 2021-02-10 14:36

I have successfully built a thin client/server using Qt\'s Tcp Sockets API. I know it works very well, because I have sent plenty of data over the wire and verified it. Howeve

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-10 15:20

    Verify the return value of qDummyServer->listen(). It should return true if the server is indeed listening at port 9000. If it returns false, chances are port 9000 is blocked by another process, and it couldn't listen. In that case, your qTestSocket connected to that other process instead of your own server.

提交回复
热议问题