当我尝试做以下事情时
init() ->
case gen_udp:open(10000, [binary, {active, false}]) of
{ok, Socket} ->
startListen(5, Socket);
end.
startListen(0, Socket) ->
Socket;
startListen(N, Socket) ->
Pid = spawn_link(fun() -> listen(Socket) end),
startListen(N-1, Socket).
listen(Socket)->
receive
{udp, Socket, Host, Port, Data} ->
...
end.
它表明它无法从任何线程接收。我做错了什么,或者实际上在erlang中是不可能的?