File: wvtimeoutstream.h

package info (click to toggle)
wvstreams 4.0.2-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,420 kB
  • ctags: 6,518
  • sloc: cpp: 52,544; sh: 5,770; ansic: 810; makefile: 461; tcl: 114; perl: 18
file content (31 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* -*- Mode: C++ -*-
 * Worldvisions Weaver Software:
 *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
 *
 */ 
#ifndef __WVTIMEOUTSTREAM_H
#define __WVTIMEOUTSTREAM_H

#include "wvstream.h"

/**
 * WvTimeoutStream is a stream that becomes !isok() after a
 * configurable number of milliseconds. It will wake up a select(). It
 * will return true if select()ed and that the timeout has
 * expired. But using it in a WvStreamList will not have it call the
 * callback/execute because the WvStreamList checks whether isok() is
 * true before doing the select().
 */

class WvTimeoutStream: public WvStream
{
    bool ok;

public:
    WvTimeoutStream(time_t msec);
    virtual bool isok() const { return ok; }

    virtual void execute();
};

#endif // __WVTIMEOUTSTREAM_H