How should one go about choosing a default TCP/IP port for a new service?

前端 未结 12 1453
刺人心
刺人心 2020-12-07 23:55

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 th

12条回答
  •  伪装坚强ぢ
    2020-12-08 00:36

    As others mention, check IANA.

    Then check your local systems /etc/services to see if there are some custom ports already in use.

    And please, don't hardcode it. Make sure it's configurable, someway, somehow -- if for no other reason that you want to be able to have multiple developers using their own localized builds at the same time.

提交回复
热议问题