How to listen to a well-known tcp port using QTcpServer

453 views Asked by At

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.

1

There are 1 answers

0
Roman Saveljev On BEST ANSWER

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