What should installer do during installation process, when default port it runs is currently used by another app?

softwareengineering.stackexchange https://softwareengineering.stackexchange.com/questions/380256

  •  14-02-2021
  •  | 
  •  

سؤال

I'm quite newcomer to the programming. I've currently faced issue described in the title. When there's already app running on default port 8080, after my app installation ends I have to change this port in the app configuration file manually so I can access it. The whole app doesn't contain any GUI installer, and there isn't any requirement to mandatory use this default port. Would it be a good solution to scan this port during installation process and check if it's in use? Are there any good practices for case described?

هل كانت مفيدة؟

المحلول

I have rarely noticed an installer checking the default port. (Scanning if done, should be for the assigned port.) It could cause issues where the port is in use on an interface the application is not using.

When assigning a default port for a program:

  • Use the well known/assigned port if the application provides a well known or registered service; and
  • Use an unassigned port otherwise.

All well known services and many assigned ports are likely listed in /etc/services. Ports are registered with IANA.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى softwareengineering.stackexchange
scroll top