Listing 6: Complete socket-based stream class designed for client-side use
template < class charT, class traits = std::char_traits<charT> > class TCPGenericClientStream : private TCPSocketWrapper, public TCPGenericStream<charT, traits> { public: TCPGenericClientStream(const char *address, int port) : TCPGenericStream<charT, traits>(*this, false) { TCPSocketWrapper::connect(address, port); } private: // copy not provided TCPGenericClientStream(const TCPGenericClientStream&); TCPGenericClientStream& operator=(const TCPGenericClientStream&); }; End of Listing