unable to reconnect to server

Bengt Kleberg bengt.kleberg@REDACTED
Mon Jan 31 13:04:36 CET 2005


Dietmar Schaefer wrote:
...deleted
> When I terminate the client and try to start it again I get
> 
> Error in process <0.322.0> on node 'cmmc@REDACTED' with exit value:
> {badarg,[{erlang,register,[test,<0.325.0>]},{test3,loop,1}]}
> 
> What has erlang:register to do with that ?

your code tries to reuse/re-register test. this is what the manual says 
(look for Failure):

''register(Name, P)

Associates the name Name with the port or pid P. Name, which must be an 
atom, can be used instead of a port or pid in the send operator (Name ! 
Message).

Returns true.

Failure: badarg if P is not an active port or process, if P is on 
another node, if Name is already in use, if the port or process is 
already registered (already has a name), if Name is not an atom, or if 
Name is the atom undefined.''



in your code test is already in use. do a
erlang:unregister(Name),
before registering. note that it is an error if Name is not the name of 
a process.


bengt



More information about the erlang-questions mailing list