Получите Порт -Эрланг
{ok, {Address, Port}} = inet:peername(Socket).
James Cook
{ok, {Address, Port}} = inet:peername(Socket).