9 #include "wvistreamlist.h"
12 int main(
int argc,
char **argv)
14 WvLog err(
"tcp", WvLog::Error);
18 sock.autoforward(*wvcon);
21 l.add_after(l.tail, wvcon,
false);
22 l.add_after(l.tail, &sock,
false);
24 while (wvcon->
isok() && sock.isok())
31 err(
"stdin: %s\n", wvcon->errstr());
32 else if (!sock.isok() && sock.geterr())
33 err(
"socket: %s\n", sock.errstr());
virtual int geterr() const
If isok() is false, return the system error number corresponding to the error, -1 for a special error...
bool select(time_t msec_timeout)
Return true if any of the requested features are true on the stream.
virtual void callback()
if the stream has a callback function defined, call it now.
WvTCPConn tries to make all outgoing connections asynchronously (in the background).
WvString is an implementation of a simple and efficient printable-string class.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
void autoforward(WvStream &s)
set the callback function for this stream to an internal routine that auto-forwards all incoming stre...
virtual bool isok() const
return true if the stream is actually usable right now
WvStreamList holds a list of WvStream objects – and its select() and callback() functions know how to...