标签:erlang
In a manner similar to processes, Ports should be considered. Ports are a datatype that encompasses all kinds of connections and sockets opened to the outside world: TCP sockets, UDP sockets, SCTP sockets, file descriptors, and so on.
?There is a general function (again, similar to processes) to count them: length(erlang:ports()) . However, this function merges in all types of ports into a single entity. Instead, one can use recon to get them sorted by type:
1> recon:port_types().[{"tcp_inet",21480},{"efile",2},{"udp_inet",2},{"0/1",1},{"2/2",1},{"inet_gethost 4 ",1}][14] http://www.erlang.org/doc/tutorial/c_port.html
[15] http://www.erlang.org/doc/tutorial/c_portdriver.html
标签:erlang
原文地址:http://blog.csdn.net/erlib/article/details/41144035