I want to listen to a well-known tcp port ,say 80 or 25 . How can I do this in Qt and using QTcpServer class? Or to be more generally, a port that is being used by someone else? Thanks in advance.

有帮助吗?

解决方案

you can not open server on the port that someone else listens to unless they stop it. Ports below 1025 belong to privileged range and depending on your Os your program may have to elevated permissions

Well you can pick different network interface, but perhaps this is not what you are after

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top