|
|
| Author |
Message |
< Yaws mailing list ~ Howto detect client connection close while streaming with st |
| Guest |
Posted: Thu Apr 15, 2010 1:30 pm |
|
|
|
Guest
|
Hello,
I would like to know the recommended way to detect when the client
disconnects from an HTTP streaming session. I am currently using
yaws_api:stream_chunk_deliver analogous to the first example given on
http://yaws.hyber.org/stream.yaws. It is just that my stream is
infinite (not finite as in the example given) thus the server will
read content and stream it forever or until the client terminates the
connection.
By looking at the API however I do not see any easy way to detect when
the client terminates the connection, thus my process will continue to
loop and do stream_chunk_deliver forever, making my yaws machine
slower and slower over time.
I have looked into older posts on this mailing list and I see that
there was a similar discussion around 2005 which discussed
possibilities of detecting yaws-process dying by spawn_linking the
streaming process. I have tried this however and it does not seem to
work for me. I do not get any message passed to me when the client
disconnects.
Anyone who has any idea on how to do this in an elegant way? Any example code?
Regards,
Stefan
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Apr 15, 2010 2:22 pm |
|
|
|
Guest
|
On Thu, Apr 15, 2010 at 8:12 AM, Stefan Hellkvist <hellkvist@gmail.com> wrote:
> Hello,
>
> I would like to know the recommended way to detect when the client
> disconnects from an HTTP streaming session. I am currently using
> yaws_api:stream_chunk_deliver analogous to the first example given on
> http://yaws.hyber.org/stream.yaws. It is just that my stream is
> infinite (not finite as in the example given) thus the server will
> read content and stream it forever or until the client terminates the
> connection.
>
> By looking at the API however I do not see any easy way to detect when
> the client terminates the connection, thus my process will continue to
> loop and do stream_chunk_deliver forever, making my yaws machine
> slower and slower over time.
>
> I have looked into older posts on this mailing list and I see that
> there was a similar discussion around 2005 which discussed
> possibilities of detecting yaws-process dying by spawn_linking the
> streaming process. I have tried this however and it does not seem to
> work for me. I do not get any message passed to me when the client
> disconnects.
>
> Anyone who has any idea on how to do this in an elegant way? Any example code?
My advice is to use the relatively new streamcontent_from_pid
capability instead, since in that case Yaws will hand control of the
socket over to a process of your choosing and so it can more easily
tell if the other end of the socket closes. See
http://yaws.hyber.org/stream.yaws
or section 7.5 of
http://yaws.hyber.org/yaws.pdf
--steve
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Apr 15, 2010 5:31 pm |
|
|
|
Guest
|
Thanks for the tip. I'll look into streamcontent_from_pid then. Great!
For others who might have the same problem I can also tell that after
sending the earlier mail I actually found out that
stream_chunk_deliver_blocked actually returns something useful, so
this problem is possible to solve with the other streaming methods as
well. stream_chunk_deliver_blocked will basically send back an error
tuple when the client has disconnected instead of the usual ok atom.
Using that can also solve my problem but I could not find anything
about this in the documentation. It was only when going through the
source code that I found this. Love open source!
Thanks!
Stefan
On Thu, Apr 15, 2010 at 4:21 PM, Steve Vinoski <vinoski@ieee.org> wrote:
> On Thu, Apr 15, 2010 at 8:12 AM, Stefan Hellkvist <hellkvist@gmail.com> wrote:
>> Hello,
>>
>> I would like to know the recommended way to detect when the client
>> disconnects from an HTTP streaming session. I am currently using
>> yaws_api:stream_chunk_deliver analogous to the first example given on
>> http://yaws.hyber.org/stream.yaws. It is just that my stream is
>> infinite (not finite as in the example given) thus the server will
>> read content and stream it forever or until the client terminates the
>> connection.
>>
>> By looking at the API however I do not see any easy way to detect when
>> the client terminates the connection, thus my process will continue to
>> loop and do stream_chunk_deliver forever, making my yaws machine
>> slower and slower over time.
>>
>> I have looked into older posts on this mailing list and I see that
>> there was a similar discussion around 2005 which discussed
>> possibilities of detecting yaws-process dying by spawn_linking the
>> streaming process. I have tried this however and it does not seem to
>> work for me. I do not get any message passed to me when the client
>> disconnects.
>>
>> Anyone who has any idea on how to do this in an elegant way? Any example code?
>
> My advice is to use the relatively new streamcontent_from_pid
> capability instead, since in that case Yaws will hand control of the
> socket over to a process of your choosing and so it can more |
|
|
| Back to top |
|
| Guest |
Posted: Thu Apr 15, 2010 6:11 pm |
|
|
|
Guest
|
On Thu, Apr 15, 2010 at 1:30 PM, Stefan Hellkvist <hellkvist@gmail.com> wrote:
> Thanks for the tip. I'll look into streamcontent_from_pid then. Great!
>
> For others who might have the same problem I can also tell that after
> sending the earlier mail I actually found out that
> stream_chunk_deliver_blocked actually returns something useful, so
> this problem is possible to solve with the other streaming methods as
> well. stream_chunk_deliver_blocked will basically send back an error
> tuple when the client has disconnected instead of the usual ok atom.
> Using that can also solve my problem but I could not find anything
> about this in the documentation. It was only when going through the
> source code that I found this. Love open source!
Patches for documentation are also welcomed, hint hint.
--steve
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist |
|
|
| Back to top |
|
| wuji |
Posted: Wed Aug 22, 2012 8:23 am |
|
|
|
User
Joined: 10 Aug 2012
Posts: 654
|
a link to go to Netflix, you would wind up up jordan 6 up at "BudgetMatch," according to the FBI. The practice is
"click hijacking."Once the FBI got around to fixing the problem problem [h4]cheap jordans[/h4] problem in 2011, it realized it couldn't simply shut down
rogue servers because infected computers would be left without a a cheap replica *beep* a functioning DNS, leaving them virtually Internet-less. So it set
temporary servers to give malware-infected Internet users time to fix fix jordan 6 fix their computers.And time runs out on Monday, July 9.(There
a planned attack this Monday that will shut down the the imitation designer *beep* the Internet; those whose computers are already infected will lose |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|