Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 QTcpSocket 上监听?我在 Tcp 上有一个简单的 p2p 连接。但我找不到在随机空闲端口上启动 QTcpSocket 的方法。我应该为它使用 QTcpServer,还是只对 1 个连接有点过分?
要侦听您必须使用 QTcpServer 的端口,请查看套接字示例。