我可以使用 QUdpSocket 连接 QTcpServer 吗?

Can I use QUdpSocket to conect with QTcpServer?

我是网络世界的新手,所以我有一个 QTcpserver 当前正在使用 newConnection 信号,但我想知道我是否可以将 QUdpSocket 与 QTcpServer 一起使用?这可能吗?

TCP is a connection oriented stream over an IP network. It guarantees that all sent packets will reach the destination in the correct order. This imply the use of acknowledgement packets sent back to the sender, and automatic retransmission, causing additional delays and a general less efficient transmission than UDP.

UDP is a connection-less protocol. Communication is datagram oriented. The integrity is guaranteed only on the single datagram. Datagrams reach destination and can arrive out of order or don't arrive at all. It is more efficient than TCP because it uses non ACK. It's generally used for real time communication, where a little percentage of packet loss rate is preferable to the overhead of a TCP connection. Whosebug

所以简单的答案是否定的,你不能,因为 tcp 和 udp 是 2 个不同的协议。