1 #include "wvistreamlist.h"
4 #include "wvstreamclone.h"
5 #include "wvlinkerhack.h"
8 WV_LINK_TO(WvConStream);
12 volatile bool want_to_die =
false;
14 static void signalhandler(
int sig)
16 fprintf(stderr,
"Caught signal %d. Exiting...\n", sig);
27 len = in->read(buf,
sizeof(buf));
29 WvIStreamList::Iter i(*list);
30 for (i.rewind(); i.next(); )
47 log(
"%s: %s\n", name, s->errstr());
56 log(
"Creating stream: '%s'\n", mon);
59 died(log, _mon, s.
addRef());
62 s->setcallback(wv::bind(bounce_to_list, s.get(), &list));
65 list.append(s.
addRef(),
true, _mon);
69 int main(
int argc,
char **argv)
72 WvLog log(argv[0], WvLog::Debug);
74 signal(SIGTERM, signalhandler);
75 signal(SIGINT, signalhandler);
79 fprintf(stderr,
"Usage: %s <stream1> [stream2 [stream3...]]\n",
87 for (
int count = 1; count < argc; count++)
88 add(log, list, argv[count]);
90 while (!want_to_die && list.count() >= 2)