Re: Grinder Connection Timeouts

Philip Aston <[email protected]>
Newsgroups gmane.comp.java.grinder.user
Message-ID <[email protected]>
1. Yes.

2. Code a timeout  yourself. Here's a hint

    from java.util import Timer, TimerTask
    from java.lang import Thread, InterruptedException

    t = Timer(True)

    class Interrupter(TimerTask):
      def __init__(self):
        self.t =Thread.currentThread()

      def run(self):
        self.t.interrupt()

    t.schedule(Interrupter(), 1000)

    try:
        Thread.sleep(2000)
        print "Slept through the night"
    except InterruptedException:
        print "Rudely interrupted"

3. See #2.


HTH,

- Phil


On 01/10/13 19:20, Benedict Dodd wrote:
> Hello Grind-a-trons
>
> I'd been under the impression that setting a connection timeout would curtain all connections at the set limit. However, if I'm reading this correctly, it will continue past the set value as long as the remote server is trickling data back:
> http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPPluginConnection.html#setTimeout(int)
>
> 1. Is that correct?
> 2. Is there a good way to put a hard limit on a request time?
> 3. Is there a good way to catch timeout exceptions?
>
> Thanks, Ben
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.