misultin: handle disconnect

Garanin Michael m-garanin@REDACTED
Sat Oct 9 09:19:42 CEST 2010


Hello!
I try use misultin as comet-server.
I copy code from post  
http://groups.google.com/group/erlang-programming/browse_thread/thread/60ad90aacb1091d/31af9240d4a92e54?lnk=gst&q=misultin+#31af9240d4a92e54 

and simple adapted for keep request 10 minutes.
I need handle disconnect (for example client close browser). I try use 
"link" but "handle_http" not died after client disconnect.

Q: how i can handle disconnect ?


Thanks!
/and sorry my bad english/

//////////////////////////////////////////////////////

handle_http(Req) ->  
        % spawn external process
        Pid = spawn(?MODULE, external_proc, [self()]),
        % send req
        Pid ! Req,
        % wait
        receive
                Response -> Response
        end.

external_proc(ControllerPid) ->

        .. after 10 minutes ....
       ControllerPid ! Req:ok("OK").


//////////////////////////////////////////////////////




More information about the erlang-questions mailing list