[erlang-questions] TCP open port count

Roberto Ostinelli roberto.ostinelli@REDACTED
Sat Feb 14 16:25:22 CET 2015


Thank you Danil, will use this.

Best,
r.


> On 13/feb/2015, at 17:17, Danil Zagoskin <z@REDACTED> wrote:
> 
> A slow but working way could be iterating over all ports searching for tcp ones:
> length([P || P <- erlang:ports(), erlang:port_info(P, name) == {name,"tcp_inet"}]).
> 
> And this is what inet:i(tcp) actually does.
> 
>> On Fri, Feb 13, 2015 at 7:03 PM, Roberto Ostinelli <roberto@REDACTED> wrote:
>> Dear list,
>> Is there a system command that can easily tell me how many TCP ports are open on a system?
>> 
>> erlang:system_info(port_count)
>> 
>> This returns all port, I'd like to know only the TCP ones.
>> 
>> Thank you,
>> r.
>> 
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
> 
> 
> 
> -- 
> Danil Zagoskin | z@REDACTED
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150214/bb7d33a5/attachment.htm>


More information about the erlang-questions mailing list