io.sockets: adding docs and tests for port-protocol.
parent
97d3c42091
commit
b864d49e8c
|
@ -292,3 +292,9 @@ HELP: with-local-address
|
|||
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
|
||||
|
|
|
@ -173,6 +173,9 @@ os unix? [
|
|||
{ 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
|
||||
|
|
Loading…
Reference in New Issue