Claw
1.7.3
|
A class to use any socket as a classic standard stream. More...
#include <socket_stream.hpp>
Public Types | |
typedef CharT | char_type |
The type of the characters in the stream. | |
typedef Traits | traits_type |
The traits carry some informations about the char_type. | |
typedef traits_type::int_type | int_type |
The type used to represent integers. | |
typedef traits_type::pos_type | pos_type |
The type used to represent a position in the stream. | |
typedef traits_type::off_type | off_type |
The type used to represent a delta in the positions. | |
typedef basic_socketbuf < char_type, traits_type > | buffer_type |
The type of the buffer manipulated by this stream. |
Public Member Functions | |
basic_socket_stream (int read_delay=-1) | |
Constructor. | |
basic_socket_stream (const char *address, int port, int read_delay=-1) | |
Constructor. | |
~basic_socket_stream () | |
Destructor. | |
buffer_type * | rdbuf () const |
Get the buffer. | |
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. | |
void | open (const char *address, int port) |
Connect the socket to an address. | |
void | open (int fd) |
Link the socket to a file descriptor. | |
void | close () |
Close the connection. |
A class to use any socket as a classic standard stream.
Definition at line 45 of file socket_stream.hpp.
|
explicit |
Constructor.
read_delay | Number of second to wait before considering nothing will come in the socket. Negative values mean infinity. |
Definition at line 39 of file socket_stream.tpp.
claw::net::basic_socket_stream< CharT, Traits >::basic_socket_stream | ( | const char * | address, |
int | port, | ||
int | read_delay = -1 |
||
) |
Constructor.
address | The address to which we will connect. |
port | The port number to use for the connection. |
read_delay | Number of second to wait before considering nothing will come in the socket. Negative values mean infinity. |
Definition at line 55 of file socket_stream.tpp.
void claw::net::basic_socket_stream< CharT, Traits >::open | ( | const char * | address, |
int | port | ||
) |
Connect the socket to an address.
address | The address to which we will connect. |
port | The port number to use for the connection. |
Definition at line 114 of file socket_stream.tpp.
void claw::net::basic_socket_stream< CharT, Traits >::open | ( | int | fd | ) |
Link the socket to a file descriptor.
fd | The file descriptor. |
Definition at line 129 of file socket_stream.tpp.
void claw::net::basic_socket_stream< CharT, Traits >::set_read_time_limit | ( | int | read_limit | ) |
Set the number of second to wait before considering nothing will come in the socket.
read_limit | The number of seconds. Negative values mean infinity. |
Definition at line 101 of file socket_stream.tpp.