From ab66a737448e60d6671bcd2f67c74271325678f4 Mon Sep 17 00:00:00 2001 From: John Benediktsson <mrjbq7@gmail.com> Date: Sat, 30 Jul 2016 11:12:40 -0700 Subject: [PATCH] io.sockets: adding port-protocol to match protocol-port. --- basis/io/sockets/sockets.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basis/io/sockets/sockets.factor b/basis/io/sockets/sockets.factor index 5bc245d989..4cee6fb3a4 100644 --- a/basis/io/sockets/sockets.factor +++ b/basis/io/sockets/sockets.factor @@ -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> ;