31 #ifndef __CLAW_BASIC_SOCKETBUF_HPP__ 32 #define __CLAW_BASIC_SOCKETBUF_HPP__ 47 template<
typename CharT,
typename Traits >
49 public std::basic_streambuf<CharT, Traits>
59 typedef typename traits_type::int_type
int_type;
62 typedef typename traits_type::pos_type
pos_type;
65 typedef typename traits_type::off_type
off_type;
74 self_type*
open(
const std::string& addr,
int port );
80 void set_read_time_limit(
int read_limit );
84 virtual int_type underflow();
85 virtual int_type overflow( int_type c = traits_type::eof() );
88 bool connect(
const std::string& addr,
int port );
90 void create_buffers();
91 void destroy_buffers();
93 bool buffered()
const;
101 char_type* m_input_buffer;
104 size_t m_input_buffer_size;
107 char_type* m_output_buffer;
110 size_t m_output_buffer_size;
113 static const size_t s_buffer_size;
119 #include <claw/impl/basic_socketbuf.tpp> 121 #endif // __CLAW_BASIC_SOCKETBUF_HPP__ basic_socket * open()
Open the socket.
traits_type::off_type off_type
The type used to represent a delta in the positions.
traits_type::int_type int_type
The type used to represent integers.
traits_type::pos_type pos_type
The type used to represent a position in the stream.
Common interface for claw::net::basic_socketbuf and claw::net::socket_server.
CharT char_type
The type of the characters in the stream.
int descriptor
Type of the system description of the socket.
basic_socketbuf< char_type, traits_type > self_type
The type of this implementation.
Common interface for claw::net::basic_socketbuf and claw::net::socket_server.
Socket buffer to be used with std::basic_stream, for easy socket reading and writing.
This is the main namespace.
Traits traits_type
The traits carry some informations about the char_type.