08-30-2018 12:30 PM
I am making a program that will communication over TCP on a private network (might want to forward to the internet in some cases down the road) to a library I am making for our customers to use. I'm a bit confused as to what TCP port I should use, if I should use a Service Name or not and if I need to register either of these with Iana. Could someone please explain why one would register or not and how I would know what TCP port I should use? Feel free to ask questions, I'm not sure what would be applicable at the moment.
Thank you much!
Solved! Go to Solution.
08-30-2018 05:15 PM
Here is a list of ports and the ranges available for use. In general, unless you envision your application becoming widely used I don't think it is necessary to register the port you will use. You can use a port number from the range of public port numbers (Ports 49152 to 65535 are Public Ports) and allow your application to use that. You generally will not run into a conflict on a given computer which will be be acting as the server. You will have control over what is running on it and can then guarantee your port number is available. Clients will use whatever port they are told in order to connect to the server. For the local port always allow the system to pick that port. That will guarantee you have no conflict on the local port.