When developing an app that will listen on a TCP/IP port, how should one go about selecting a default port? Assume that this app will be installed on many computers, and that avoiding port conflicts is desired.
相关问题
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- What would prevent code running in a Docker contai
- How to run tcp and udp on a single port at same ti
- Docker-Compose: Can't Connect to Mongo
- Make Laravel Homestead Accessible via the Internet
相关文章
- Socket编程 TCP方式发送时间有点长
- RMI Threads prevent JVM from exiting after main()
- fsc.exe is very slow because it tries to access cr
- How many times will TCP retransmit
- Writing an OS X kernel extension to implement Linu
- What's “tcp-backlog” in redis.conf
- Virtual Box limit Bandwith on network [closed]
- Is ICMP a transport layer protocol?
Well, you can reference some commonly used port numbers here and try not to use anyone else's.
If by "open to the public at large" you mean you're opening ports on your own systems, I'd have a chat with your system administrators about which ports they feel comfortable with doing that with.
Choose a number that is not very common
If this is for an application that you expect to be used widely, then register a number here so no-one else uses it.
Otherwise, just pick an unused one randomly.
The problem with using one in the dynamic range is that it may not be available because it may be being used for a dynamic port number.
If by widely-used, you mean you want to protect against other people using it in the future, you can apply to have it marked as reserved for your app by IANA here
Go here and pick a port with the description
Unassigned
You probably want to avoid using any ports from this list (Wikipedia).
I would just pick one, and once the app is used by the masses, the port number will become recognized and included in such lists.