Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top