30 #ifndef __CLAW_SOCKET_STREAM_HPP__
31 #define __CLAW_SOCKET_STREAM_HPP__
44 template<
typename CharT,
typename Traits = std::
char_traits<CharT> >
55 typedef typename traits_type::int_type
int_type;
58 typedef typename traits_type::pos_type
pos_type;
61 typedef typename traits_type::off_type
off_type;
77 void open(
const char* address,
int port );
98 #endif // __CLAW_SOCKET_STREAM_HPP__
buffer_type * rdbuf() const
Get the buffer.
void open(const char *address, int port)
Connect the socket to an address.
traits_type::off_type off_type
The type used to represent a delta in the positions.
CharT char_type
The type of the characters in the stream.
basic_socket_stream< wchar_t > wsocket_stream
Implementation of the basic_socket_stream for the wide characters.
Implementation of the claw::net::basic_socket_stream class.
basic_socket_stream< char > socket_stream
Implementation of the basic_socket_stream for the char type.
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.
A class to use any socket as a classic standard stream.
Socket buffer to be used with std::basic_socket_stream, for easy socket reading and writing...
Traits traits_type
The traits carry some informations about the char_type.
traits_type::pos_type pos_type
The type used to represent a position in the stream.
traits_type::int_type int_type
The type used to represent integers.
basic_socket_stream(int read_delay=-1)
Constructor.
~basic_socket_stream()
Destructor.
basic_socketbuf< char_type, traits_type > buffer_type
The type of the buffer manipulated by this stream.