Skip to content
Dave Cottlehuber edited this page Jul 6, 2015 · 2 revisions

list all open UDP ports

 UDP_Ports = fun() -> hd(lists:flatten(lists:map(fun(P)->
  I = erlang:port_info(P),
  case proplists:get_value(name, I) of
    "udp_inet" -> proplists:get_value(connected, I);
    _ -> [] end end ,
  erlang:ports()))) end.

get the process managing port 123

{ok, Pid} = peer_worker:where_is(123).
Clone this wiki locally