WvStreamclone is probably one of the coolest, and most confusing parts within the WvStream library. Almost everyone who has ever encountered this stream the first time has had to stop and go over it a few times before they can wrap their head around what is going on. Ok.. now that I've scared you... I'm going to tell you that it is really quite easy. Most of the time, when you are using a WvStreamClone, you will be doing something like the following:
1. Start a Stream on a TCP Connection 2. Change this Stream into something else (like an SSL Stream) 3. And then talk some sort of high level protocol (like HTTP)
So you have one stream (a TCP Connection), that morphs into another stream TYPE (an SSL Stream), that then becomes another stream (talking HTTP). All the while, not changing the stream that was started and added to the original WvStreamList.
WvStreamClone simply forwards all requests to the "cloned" stream. A class derived from WvStreamClone can contain a WvStream as a dynamically allocated data member, but act like the stream itself.
This is useful for classes that need to create/destroy WvPipes while they run, for example, yet do not want users to know about the member variable.
WvStreamClone _does_ attempt to close the cloned stream in the destructor.
Insert Example here...