Ignore:
Timestamp:
Nov 14, 2016 11:35:41 AM (3 years ago)
Author:
ldelgass
Message:

merge r6576:6577 from nanovis trunk (timeout option)

Location:
nanovis/branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2

  • nanovis/branches/1.2/nanovisServer.cpp

    r6395 r6619  
    5757ResponseQueue *nv::g_queue = NULL;
    5858#endif
     59long nv::g_idleTimeout = -1L;
    5960
    6061#ifdef USE_THREADS
     
    385386
    386387#if defined(USE_NEW_EVENT_LOOP) || defined(USE_THREADS)
    387     if (processCommands(NanoVis::interp, g_inBufPtr, g_fdOut) < 0) {
     388    struct timeval timeout;
     389    timeout.tv_sec = g_idleTimeout;
     390    timeout.tv_usec = 0L;
     391    if (processCommands(NanoVis::interp, g_inBufPtr, g_fdOut, &timeout) < 0) {
    388392        exitService(1);
    389393    }
     
    477481    const char *resourcePath = NULL;
    478482    while (1) {
    479         static struct option long_options[] = {
    480             {"debug",   no_argument,       NULL, 'd'},
    481             {"path",    required_argument, NULL, 'p'},
    482             {0, 0, 0, 0}
    483         };
    484         int option_index = 0;
    485         int c = getopt_long(argc, argv, "dp:i:o:", long_options, &option_index);
     483        int c = getopt(argc, argv, "dp:i:o:t:");
    486484        if (c == -1) {
    487485            break;
     
    507505            }
    508506        }
     507            break;
     508        case 't':
     509            // Idle timeout in seconds
     510            g_idleTimeout = atol(optarg);
    509511            break;
    510512        case '?':
Note: See TracChangeset for help on using the changeset viewer.