io.sockets: adding port-protocol to match protocol-port.

char-rename
John Benediktsson 2016-07-30 11:12:40 -07:00
parent 2e9704a406
commit ab66a73744
1 changed files with 3 additions and 0 deletions

View File

@ -459,6 +459,9 @@ M: invalid-local-address summary
: protocol-port ( protocol -- port )
[ f getservbyname [ port>> htons ] [ f ] if* ] [ f ] if* ;
: port-protocol ( port -- protocol )
[ htons f getservbyport [ name>> ] [ f ] if* ] [ f ] if* ;
: <any-port-local-inet4> ( -- inet4 ) f 0 <inet4> ;
: <any-port-local-inet6> ( -- inet6 ) f 0 <inet6> ;