Bad call = gen_server shutdown?

Mickael Remond mickael.remond@REDACTED
Fri Jan 14 18:14:57 CET 2005


blaguehubert wrote:
> I wrote a gen_server module "repartiteur" with 2 functions : 
> propose_link/1 and get_proposed_links/0.
> 
> It seems that if I call get_proposed_links with an argument (by 
> mistake), it shutdowns the server...
> 
> Is this normal?

Yes. This is normal as you are starting your server with start_link. A 
link is created between the main shell process. The link is 
bidirectional. By doing a mistake in your command you are crashing the 
shell (which is restarted with a new process number, check with the 
information listing i().).

You have two solutions:
- Start your server without linking to your shell process.
- Start your server from a shell process and type different commands, 
from another shell process.

To start a new shell process hit control-G, and type s to start a new 
local shell process. (? for help). List the current jobs with j. Connect 
to the job (shell process) you want to work in with c + the number of 
the process.

This process is described in the French Erlang book (as you seem to be 
from France).

I hope this help,

-- 
Mickaël Rémond
  http://www.erlang-projects.org/



More information about the erlang-questions mailing list