Erlang – ports

Erlang ports

In this guide, we will discuss Erlang Ports. Returns a list of all ports on the local node.

Syntax

ports()

Parameters

  • None

Return Value

Returns a list of all ports on the local node.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~w~n",[erlang:ports()]).

Output

When we run the above program we will get the following result. Depending on the system, the output will differ.

[#Port<0.0>,#Port<0.49>,#Port<0.383>,#Port<0.392>]

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply