Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个非常简单的问题,与打印连接的进程 ID 有关。例如打印出 Listen in this one?我假设Listen是一个Pid btw ...
{ok, Listen} = gen_tcp:listen();
您可以io:format使用~p格式说明符打印它,它可以打印任何 Erlang 术语:
io:format
~p
> io:format("~p~n", [Listen]). #Port<0.605>
(Listen实际上不是一个 pid,而是一个端口标识符。)
Listen