WvStreams
wvstreamex7.cc
00001 /*
00002  * A WvStream example.
00003  *
00004  * Some text about this example...
00005  */
00006 
00007 #include <wvstream.h>
00008 
00009 int main()
00010 {
00011     int nothing_count = 0;
00012     wvcon->autoforward(*wvcon);
00013 
00014     while (wvcon->isok())
00015     {
00016         if (wvcon->select(1000))
00017         {
00018             nothing_count = 0;
00019             wvcon->callback();
00020         }
00021         else
00022         {
00023             nothing_count++;
00024             wvcon->print("[TICK]");
00025             if (nothing_count == 10)
00026             {
00027                 wvcon->print("[TIMEOUT]\n");
00028                 break;
00029             }
00030         }
00031     }
00032 }