How to choose which port to use when building a windows service? (windows & .net) -


I am writing a window service that will expose an HTTP permanent web service to other processes on the machine. It will be deployed on many different computers on different machines which I have less / no control. Which port should I select on which should my service be heard?

I will make it configurable, but to know how to choose some reasonable default.

fyi I am planning to use .NET 3.5 (unable to use 4.0) for reasons of deployment) and with WCF.

UPDATE : To clarify, these are the corporate non-development machines. I want to choose a port which is unlikely to be used for anything else. Pascal Thivent @ Thanks) I think that one should choose dynamic / private category

Dynamic and / or private ports are between 49152 to 65535

< P> So is there a better way to choose a port within that range, or I just Randomly choose? official

registered with the Internet Assign Number Authorization (IANA) for HTTP Assignments:

  • 80: Standard ports for HTTP,
  • 8080: HTTP optional (usually running as a non-root user by a cache or proxy or web server

Below are port non-governmental port (IANA) used:

  • 8081: HTTP optional
  • 8090: HTTP optional (port 8080 vs) I have no idea what type of machines you are targeting, but if they include development machines, then perhaps I might be less likely. Onflicts to use 8090

    Reference


Comments