[erlang-questions] misultin: handle disconnect

Roberto Ostinelli roberto@REDACTED
Sat Oct 9 18:31:54 CEST 2010


hi michael,

try to use the code in the /examples directory instead, since the one
you are providing here is a specific user case, not recommended unless
you know exactly what you are doing.

that being said, misultin is not built to empower a comet application.
it does not provide events, like sockets being closed, to the http
handle_loop. instead of comet, it has been preferred to support
websockets, something misultin is quite good at.

if you need comet instead, you will be better off using misultin core
and build your own comet application over that.

cheers,

r.



2010/10/9 Garanin Michael <m-garanin@REDACTED>:
> 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