> --
> You received this message because you are subscribed to the Google Groups "MochiWeb" group.
> To post to this group, send email to moch...@googlegroups.com.
> To unsubscribe from this group, send email to mochiweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mochiweb?hl=en.
>
>
((((((( JLM ))))))))
((((((( JLM ))))))))
Detecting disconnections is not really necessary, the process will
terminate when that happens... but only while you're waiting on
activity from the socket, such as parsing the request body or waiting
for the next request. Richard's method should only be useful if you're
long-polling and you want to detect a disconnect from the client
before you send the response.
On Wed, Apr 20, 2011 at 12:37 AM, JLM <jlam...@gmail.com> wrote:
> Sorry and thanks for quick answers.
>
> I've found my mistake by starting from a new sample app and it works
> perfectly. It's absolutely not Mochiweb's fault.
>
> I've used a sample code on an article by Richard Jones about a one-
> million users Comet Application.
> In comments, someone provided a way to detect for disconnections by
> configuring Socket :
> Socket = Req:get(socket),
> inet:setopts(Socket, [{active, once}]),
>
> This is the reason why POST requests never ended.
> So I've moved this code in the GET request case I used for the Comet
> behavior.
> Maybe would you have a better way to detect when a client
> disconnects ?
>
>
> On Apr 19, 7:34 pm, Bob Ippolito <b...@redivi.com> wrote:
>> What exactly is the code you're using? Which platform are you running it on?
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Apr 19, 2011 at 9:57 AM, Julien <jlama...@gmail.com> wrote:
>> > I've done the same test with a wget command with the option --post-data combined with datas '<json struct>'. Note : wget will automatically provide a Content-Length header.
>> > Got the same behavior, the request stays hanged in the recv method of mochiweb_request
>>
>> > ((((((( JLM ))))))))
>>
>> > On 19 avr. 2011, at 18:07, Bob Ippolito <b...@redivi.com> wrote:
>>
>> >> Are you sure the client is sending a POST request, with data?
>>
>> >> On Tue, Apr 19, 2011 at 8:10 AM, JLM <jlama...@gmail.com> wrote:
>> >>> Hi,
>> >>> I am trying to simply use the function Data = Req:parse_post(), in my
>> >>> app but the server never respond until 300 seconds.
>> >>> It seems that it's waiting for something.
>> >>> My HTTP Client is a firefox add-on called "REST Client" on which I've
>> >>> configured a POST request with a request Boyd to an URL served by my
>> >>> mochiweb application (GET requests work fine).
>>
>> >>> Mochiweb version : retrieved from master branch on github on the
>> >>> 04/14/2011
>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google Groups "MochiWeb" group.
>> >>> To post to this group, send email to moch...@googlegroups.com.
>> >>> To unsubscribe from this group, send email to mochiweb+u...@googlegroups.com.
>> >>> For more options, visit this group athttp://groups.google.com/group/mochiweb?hl=en.
>>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups "MochiWeb" group.
>> >> To post to this group, send email to moch...@googlegroups.com.
>> >> To unsubscribe from this group, send email to mochiweb+u...@googlegroups.com.
>> >> For more options, visit this group athttp://groups.google.com/group/mochiweb?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups "MochiWeb" group.
>> > To post to this group, send email to moch...@googlegroups.com.
>> > To unsubscribe from this group, send email to mochiweb+u...@googlegroups.com.
>> > For more options, visit this group athttp://groups.google.com/group/mochiweb?hl=en.