[erlang-questions] Can gen_tcp:close() close a socket which is still sending?

Tony Rogvall <>
Mon Jun 15 00:48:29 CEST 2009

>> The "safe" way to terminate a sending socket is to use shutdown(S,  
>> write)
>> and then wait for the server side to close the connection.
> This here may be exactly what I need to know.  To check, first,
> though: in context, erlang _is_ the server side.  Does that change
> things?  The client is any web browser.  I apologize for having been
> unclear.

Then perhaps you should check the exit_on_close option in the inet  
If the client uses shutdown you will be able to write data to the  
client and
then close after this is done.


More information about the erlang-questions mailing list