How to choose which port to use when building a windows service? (windows & .net) -
i'm writing windows service expose http restful web service other processes on machine. deployed lots of machines on various corporate desktops have little/no control over. how should choose port service should listen on?
i'll make configurable, need know how choose reasonable default(s).
fyi i'm planning on using .net 3.5 (unable use 4.0 deployment reasons) , wcf wcf rest starter toolkit.
update: clarify, these corporate non-development machines. want choose port that's not used else. guess list of port numbers (thanks @pascal thivent) should choose 1 in dynamic/private range
the dynamic and/or private ports 49152 through 65535
so there better way of choosing port within range, or choose randomly?
the official assignments registred internet assigned numbers authority (iana) http are:
- 80: standard port http,
- 8080: http alternate (commonly used cache or proxy or web server running non-root user)
the ports below non official ports (not registered iana) used:
- 8081: http alternate
- 8090: http alternate (used alternative port 8080)
i don't know kind of machines targeting if include development machines, use 8090 minimize possible conflicts.
Comments
Post a Comment