37 template<
typename CharT,
typename Traits>
40 : m_buffer(read_delay)
42 this->init(&m_buffer);
53 template<
typename CharT,
typename Traits>
55 (
const char* address,
int port,
int read_delay )
56 : m_buffer(read_delay)
58 this->init(&m_buffer);
66 template<
typename CharT,
typename Traits>
76 template<
typename CharT,
typename Traits>
87 template<
typename CharT,
typename Traits>
90 return m_buffer.is_open();
99 template<
typename CharT,
typename Traits>
103 m_buffer.set_read_time_limit(read_limit);
112 template<
typename CharT,
typename Traits>
114 (
const char* address,
int port )
116 if ( !m_buffer.open(address, port) )
117 this->setstate(std::ios_base::failbit);
128 template<
typename CharT,
typename Traits>
131 if ( !m_buffer.open(fd) )
132 this->setstate(std::ios_base::failbit);
141 template<
typename CharT,
typename Traits>
144 if ( !m_buffer.close() )
145 this->setstate(std::ios_base::failbit);
buffer_type * rdbuf() const
Get the buffer.
void open(const char *address, int port)
Connect the socket to an address.
void close()
Close the connection.
bool is_open() const
Tell if the stream is open.
void set_read_time_limit(int read_limit)
Set the number of second to wait before considering nothing will come in the socket.
basic_socket_stream(int read_delay=-1)
Constructor.
~basic_socket_stream()
Destructor.