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

后端 未结 3 1156
情歌与酒
情歌与酒 2021-02-10 15:09

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条回答
  •  星月不相逢
    2021-02-10 15:18

    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.

提交回复
热议问题