Menu

Req: delay after traffic stops before standby

Anonymous
2013-03-11
2014-03-23
  • Anonymous

    Anonymous - 2013-03-11

    I use Coffee with Serviio. I have PC set to standby after 30 minutes of inactivity. Coffee works great, the problem is that if I pause the movie I am watching (this could also happen just with remote access, not necessarily with Serviio) it standbys afters only a minute or two. There needs to be a user configurable delay to standby after x minutes after network activity stops, for this type of scenario. I'd use for example 10 minutes or so.

     
  • mako

    mako - 2014-03-23

    Hi Steven,
    First I have to say that Coffe is a great piece of software and is working great, but this is the one feature I'm really missing. I'm using Coffe in similar config as OP and also facing that problem when PC just shuts it self down after very short time ...
    I looked at the code and I think it would be very easy to add such delay. I don't now .NET (only C/C++) but if I get it right it's only a matter of adding one "timeout" variable, a few if's and a couple of other things :) (like new "reason" or box where user will input timeout threshold value in minutes). It should go into the "timer1_Tick" function and could look like this:

    [...]
    if (bytesReceivedSpeed > numericUpDown1.Value)
    {
        if (numericUpDown1.Value != 0){
            SystemRequired("Download");
            timeout = 0;            // Timer reset every time "transfer" occured
        }
    }
    else
    {
        SystemNotRequired("Download");
    }
    if (bytesSentSpeed > numericUpDown2.Value)
    {
        if (numericUpDown2.Value != 0){
            SystemRequired("Upload");
            timeout = 0;            // Timer reset every time "transfer" occured
        }
    }
    else
    {
        SystemNotRequired("Upload");
    }
    
    if(timeout < timeoutThreshold)    // When timer is below threshold
    {
        SystemRequired("Timeout");    // Block sleep with reason "timeout"
        timeout++;                    // and increment timer value
    }
    else                              // When timer gets above threshold
    {                                    // Unlock system and leave timer above 
        SystemNotRequired("Timeout");    // threshold (untouched) so it will stay
    }                                    // there till next "download above threshold"
    [...]
    

    As I see the timer1_Tick is executed once per second so timeout values should of course represent seconds. Also maybe "if(timeout ..." should go before "if(bytesReceivedSpeed ..." in order to "Milk" show "Download traffic above threshold" (when actual download is active) istead of some kind of "Timeout after transfer".
    I hope that this would be helpful and we will see that feature soon :)
    Thanks.

     

Log in to post a comment.