HELP: protocol-port
{ $values { "protocol" "a protocol string" } { "port" { $maybe integer } } }
{ $description "Outputs the port number associated with a protocol, or " { $link f } " if the protocol is unknown." } ;
+
+HELP: port-protocol
+{ $values { "port" integer } { "protocol" { $maybe "a protocol string" } } }
+{ $description "Outputs the protocol associated with a port number, or " { $link f } " if the port number is unknown." } ;
+
+{ protocol-port port-protocol } related-words
{ 80 } [ "http" protocol-port ] unit-test
{ f } [ f protocol-port ] unit-test
+{ "http" } [ 80 port-protocol ] unit-test
+{ f } [ f port-protocol ] unit-test
+
[ "you-cant-resolve-me!" resolve-host ] [ addrinfo-error? ] must-fail-with
[ ] [ B{ 1 2 3 } f 9000 <inet4> send-once ] unit-test