inet:i() 这个函数可以列出网络的连接情况 很实用。
(y@erl98.3322.org)46> inet:i().
Port Module Recv Sent Owner Local Address Foreign Address State
7 inet_tcp 0 0 <0.20.0> *:13660 *:* ACCEPTING
9 inet_tcp 4 16 <0.18.0> localhost:48084 localhost:epmd CONNECTED
97 inet_tcp 62399 182817 <0.38.0> 192.168.0.98:13660 192.168.0.243:19342 CONNECTED
Port Module Recv Sent Owner Local Address Foreign Address State
ok
其实erlang的好多module都有i 函数都是 取得该模块的信息的 很方便。
(y@erl98.3322.org)46> inet:i().
Port Module Recv Sent Owner Local Address Foreign Address State
7 inet_tcp 0 0 <0.20.0> *:13660 *:* ACCEPTING
9 inet_tcp 4 16 <0.18.0> localhost:48084 localhost:epmd CONNECTED
97 inet_tcp 62399 182817 <0.38.0> 192.168.0.98:13660 192.168.0.243:19342 CONNECTED
Port Module Recv Sent Owner Local Address Foreign Address State
ok
其实erlang的好多module都有i 函数都是 取得该模块的信息的 很方便。
本文介绍如何使用Erlang内置的inet:i()函数来查看当前系统的网络连接状态,包括监听端口、已建立连接等信息。

被折叠的 条评论
为什么被折叠?



