EXIT messages from sockets...?

Adam Aquilon aa@REDACTED
Mon May 28 14:22:28 CEST 2001


Hi all,

Does anyone know if Socket processes can send EXIT signals
to their owners, and if so, what kind of messages that may
be sent?

Also, under which circumstances can a listening port be 
closed by the Erlang VM or the OS?



Background:

I have a server listening to a TCP port (i.e. owns a listening
socket). The server spawns off processes handling each new
client that connects to this port in the standard, time-honored
fashion.

Sometimes, usually during high load it seems, the server that
owns the listening socket gets a message looking like this:

   {'EXIT',#Port<N,NNNN>,normal}

After this, the port is closed (note that it *can* be reopened
successfully).

I've seen that some pieces of kernel code seem to guard against
this kind of thing happning, for instance in inet_db.erl:

handle_info({'EXIT', Socket, _}, State) when port(Socket) ->
    ets:delete(inet_db, {socket,Socket}),
    {noreply, State};

But the documentation doesn't seem to mention that such things
can happen. Any light shed over this behaviour will be 
appreciated.

Regards,
Adam Aquilon




More information about the erlang-questions mailing list