10#if __has_include("defs.h")
14#include "safe_winsock.h"
40 : std::basic_iostream<T> (new
sockbuf<T> ()){};
44 : std::basic_iostream<T> (new
sockbuf<T> (sb)){};
48 : std::basic_iostream<T> (new
sockbuf<T> (s)){};
52 : std::basic_iostream<T> (new
sockbuf<T> (t, domain, proto)){};
62 return (
sockbuf<T>*)std::basic_ios<T>::rdbuf ();
73 : std::basic_iostream<T> (new
sockbuf<T> ())
76 rdbuf ()->connect (remote);
80generic_sockstream< T >::~generic_sockstream ()
82 delete std::basic_ios<T>::rdbuf ();
An IO stream using a sockbuf object as the underlying streambuf.
Definition sockstream.h:36
generic_sockstream(const sock &s)
Create from an existing mlib::sock.
Definition sockstream.h:47
sockbuf< T > * operator->()
Return the buffer used by this stream.
Definition sockstream.h:65
generic_sockstream(const sockbuf< T > &sb)
Create from an existing mlib::sockbuf.
Definition sockstream.h:43
generic_sockstream()
Default constructor.
Definition sockstream.h:39
sockbuf< T > * rdbuf()
Return the buffer used by this stream.
Definition sockstream.h:60
generic_sockstream(const inaddr &remote, sock::type t=sock::stream)
Create a SOCK_STREAM connected to a remote peer.
Definition sockstream.h:72
generic_sockstream(sock::type t, int domain=AF_INET, int proto=0)
Create a SOCK_STREAM or SOCK_DGRAM stream.
Definition sockstream.h:51
Wrapper for sockaddr structure.
Definition inaddr.h:25
We keep a reference counter associated with each sock object because it is more expensive to duplicat...
Definition sock.h:19
type
socket types
Definition sock.h:23
Provide functions required by streambuf interface using an underlying socket.
Definition sockbuf.h:58
generic_sockstream< char > sockstream
Definition sockstream.h:95
generic_sockstream< char > osockstream
Definition sockstream.h:91
generic_sockstream< char > isockstream
Definition sockstream.h:87
Definition of sockbuf class.