<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Thank you Danil, will use this.</div><div><br></div><div>Best,</div><div>r.<br><br></div><div><br>On 13/feb/2015, at 17:17, Danil Zagoskin <<a href="mailto:z@gosk.in">z@gosk.in</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">A slow but working way could be iterating over all ports searching for tcp ones:<div>length([P || P <- erlang:ports(), erlang:port_info(P, name) == {name,"tcp_inet"}]).<br></div><div><br></div><div>And this is what inet:i(tcp) actually does.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 7:03 PM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">roberto@widetag.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear list,<div>Is there a system command that can easily tell me how many TCP ports are open on a system?</div><div><br></div><div><span style="font-family:monospace,monospace;font-size:12.8000001907349px">erlang:system_info(</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">port_count)</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8000001907349px"><br></span></div><div>This returns all port, I'd like to know only the TCP ones.<span style="font-family:monospace,monospace;font-size:12.8000001907349px"><br></span></div><div><br></div><div>Thank you,</div><div>r.</div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font face="'courier new', monospace">Danil Zagoskin | <a href="mailto:z@gosk.in" target="_blank">z@gosk.in</a></font></div></div></div>
</div>
</div></blockquote></body></html>