Interrupting passive socket recv

Sean Hinde <>
Tue Nov 14 13:04:01 CET 2000


Peter,

> Just a few thoughts... What if you spawn a separate process 
> just to handle the
> receiving of TCP messages? To avoid flooding this process (in 

Yes, I also thought a bit about this solution. The drawback is that it
introduces an extra message transfer as the recv process will have to send
the replies back to my marshalling process which knows who asked the query
and so can return the answer to the right place.

Killing the recv process is also a bit nasty as well, though it does raise
the additional question of how one interrupts a gen_tcp:accept. This is an
issue for code upgrades as well as a general programming issue. The options
seem to be the same as documented for recv - timeout and retry to allow
space for other Erlang messages to be received - which is pretty horrible
(lost connections)

Any more tricks up anyones sleeve for this one?

Sean



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.





More information about the erlang-questions mailing list