Open
Description
Describe the Bug
README description of Stdlib::Port
:
Matches a valid TCP/UDP Port number.
Port 0 is reserved for both TCP and UDP and most implementations will reject it. It is now used when binding to tell the kernel to find an available port. Hence, configurations that are pedantic will want to disable it to avoid misconfiguration.
Expected Behavior
Either the description should say "any TCP/UDP port" and there is a type to represent valid port numbers (Interger[1, 65535]
) or the lower bound is changed from 0 to 1. The latter change should apply to any derived type too.
Additional Context
Technically (by the original RFC), port 0 was reserved, but the behavior it now has when calling bind
makes allowing the value slightly dangerous: https://www.rfc-editor.org/rfc/rfc1340#page-7