[erlang-questions] badarg when registering httpd process?

Roger Lipscombe roger@REDACTED
Fri Jul 11 18:18:56 CEST 2014


Ah. I knew that I couldn't have two processes with the same name.
Didn't realise that it was constrained the other way as well. Thanks.


On 11 July 2014 15:44, Fred Hebert <mononcqc@REDACTED> wrote:
> On 07/11, Roger Lipscombe wrote:
>> I'm attempting to register an httpd process with a name (mainly so
>> that I can figure out the dynamically-assigned port number later).
>>
>> I get badarg when I call register, as follows:
>>
>> [snip]
>>
>> Is there something special about httpd processes that means that they
>> can't be registered?
>>
>
> A process can't be registered twice:
>
> 1> application:ensure_all_started(inets).
> {ok,[inets]}
> 2> {ok, Pid} = inets:start(httpd, [{port, 0}, {server_name,
> 2> "localhost"}, {server_root, "/tmp"}, {document_root, "/tmp"}]).
> {ok,<0.67.0>}
> 3> process_info(Pid, registered_name).
> {registered_name,httpd_instance_sup_54506}
>
> It already has a name and therefore you can't register it a second time.
>
> Regards,
> Fred.



More information about the erlang-questions mailing list