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 函数都是 取得该模块的信息的 很方便。