#include <socket_stream.hpp>
Definition at line 45 of file socket_stream.hpp.
Public Types | |
| typedef CharT | char_type |
| typedef Traits | traits_type |
| typedef traits_type::int_type | int_type |
| typedef traits_type::pos_type | pos_type |
| typedef traits_type::off_type | off_type |
| typedef basic_socketbuf < char_type, traits_type > | buffer_type |
Public Member Functions | |
| basic_socket_stream () | |
| Constructor. | |
| basic_socket_stream (const char *address, int port) | |
| Constructor. | |
| ~basic_socket_stream () | |
| Destructor. | |
| buffer_type * | rdbuf () const |
| Get the buffer. | |
| bool | is_open () const |
| Tell if the stream is open. | |
| 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. | |
Private Attributes | |
| buffer_type | m_buffer |
| The buffer used for operations. | |
| typedef CharT claw::net::basic_socket_stream< CharT, Traits >::char_type |
Definition at line 48 of file socket_stream.hpp.
| typedef Traits claw::net::basic_socket_stream< CharT, Traits >::traits_type |
Definition at line 49 of file socket_stream.hpp.
| typedef traits_type::int_type claw::net::basic_socket_stream< CharT, Traits >::int_type |
Definition at line 50 of file socket_stream.hpp.
| typedef traits_type::pos_type claw::net::basic_socket_stream< CharT, Traits >::pos_type |
Definition at line 51 of file socket_stream.hpp.
| typedef traits_type::off_type claw::net::basic_socket_stream< CharT, Traits >::off_type |
Definition at line 52 of file socket_stream.hpp.
| typedef basic_socketbuf<char_type, traits_type> claw::net::basic_socket_stream< CharT, Traits >::buffer_type |
Definition at line 54 of file socket_stream.hpp.
| claw::net::basic_socket_stream< CharT, Traits >::basic_socket_stream | ( | ) | [inline] |
Constructor.
Definition at line 36 of file socket_stream.tpp.
References claw::net::basic_socket_stream< CharT, Traits >::m_buffer.
00037 { 00038 init(&m_buffer); 00039 } // basic_socket_stream::basic_socket_stream()
| claw::net::basic_socket_stream< CharT, Traits >::basic_socket_stream | ( | const char * | address, | |
| int | port | |||
| ) | [inline] |
Constructor.
| address | The address to which we will connect. | |
| port | The port number to use for the connection. |
Definition at line 49 of file socket_stream.tpp.
References claw::net::basic_socket_stream< CharT, Traits >::m_buffer, and claw::net::basic_socket_stream< CharT, Traits >::open().
00050 { 00051 init(&m_buffer); 00052 open(address, port); 00053 } // basic_socket_stream::basic_socket_stream()
| claw::net::basic_socket_stream< CharT, Traits >::~basic_socket_stream | ( | ) | [inline] |
| claw::net::basic_socket_stream< CharT, Traits >::buffer_type * claw::net::basic_socket_stream< CharT, Traits >::rdbuf | ( | ) | const [inline] |
Get the buffer.
Definition at line 71 of file socket_stream.tpp.
References claw::net::basic_socket_stream< CharT, Traits >::m_buffer.
00072 { 00073 return const_cast<buffer_type*>(&m_buffer); 00074 } // basic_socket_stream::rdbuf()
| bool claw::net::basic_socket_stream< CharT, Traits >::is_open | ( | ) | const [inline] |
Tell if the stream is open.
Definition at line 81 of file socket_stream.tpp.
References claw::net::basic_socketbuf< CharT, Traits >::is_open(), and claw::net::basic_socket_stream< CharT, Traits >::m_buffer.
| void claw::net::basic_socket_stream< CharT, Traits >::open | ( | const char * | address, | |
| int | port | |||
| ) | [inline] |
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 93 of file socket_stream.tpp.
References claw::net::basic_socket_stream< CharT, Traits >::m_buffer, and claw::net::basic_socketbuf< CharT, Traits >::open().
Referenced by claw::net::basic_socket_stream< CharT, Traits >::basic_socket_stream().
00095 { 00096 if ( !m_buffer.open(address, port) ) 00097 this->setstate(std::ios_base::failbit); 00098 else 00099 this->clear(); 00100 } // basic_socket_stream::open()
| void claw::net::basic_socket_stream< CharT, Traits >::open | ( | int | fd | ) | [inline] |
Link the socket to a file descriptor.
| fd | The file descriptor. |
Definition at line 109 of file socket_stream.tpp.
References claw::net::basic_socket_stream< CharT, Traits >::m_buffer, and claw::net::basic_socketbuf< CharT, Traits >::open().
00110 { 00111 if ( !m_buffer.open(fd) ) 00112 this->setstate(std::ios_base::failbit); 00113 else 00114 this->clear(); 00115 } // basic_socket_stream::open()
| void claw::net::basic_socket_stream< CharT, Traits >::close | ( | ) | [inline] |
Close the connection.
Definition at line 122 of file socket_stream.tpp.
References claw::net::basic_socketbuf< CharT, Traits >::close(), and claw::net::basic_socket_stream< CharT, Traits >::m_buffer.
00123 { 00124 if ( !m_buffer.close() ) 00125 this->setstate(std::ios_base::failbit); 00126 } // basic_socket_stream::close()
buffer_type claw::net::basic_socket_stream< CharT, Traits >::m_buffer [private] |
The buffer used for operations.
Definition at line 72 of file socket_stream.hpp.
Referenced by claw::net::basic_socket_stream< CharT, Traits >::basic_socket_stream(), claw::net::basic_socket_stream< CharT, Traits >::close(), claw::net::basic_socket_stream< CharT, Traits >::is_open(), claw::net::basic_socket_stream< CharT, Traits >::open(), and claw::net::basic_socket_stream< CharT, Traits >::rdbuf().
1.5.5