Claw  1.7.3
Public Types | Public Member Functions | List of all members
claw::net::basic_osocket_stream< CharT, Traits > Class Template Reference

A class to use any socket as a classic standard output stream. More...

#include <osocket_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_osocket_stream ()
 Constructor.
 basic_osocket_stream (const std::string &address, int port)
 Constructor.
 ~basic_osocket_stream ()
 Destructor.
buffer_typerdbuf () const
 Get the output buffer.
bool is_open () const
 Tell if the stream is open.
void open (const std::string &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.

Detailed Description

template<typename CharT, typename Traits = std::char_traits<CharT>>
class claw::net::basic_osocket_stream< CharT, Traits >

A class to use any socket as a classic standard output stream.

Author
Julien Jorge

Definition at line 45 of file osocket_stream.hpp.

Constructor & Destructor Documentation

template<typename CharT , typename Traits >
claw::net::basic_osocket_stream< CharT, Traits >::basic_osocket_stream ( const std::string &  address,
int  port 
)

Constructor.

Parameters
addressThe address to which we will connect.
portThe port number to use for the connection.

Definition at line 50 of file osocket_stream.tpp.

Member Function Documentation

template<typename CharT , typename Traits >
void claw::net::basic_osocket_stream< CharT, Traits >::open ( const std::string &  address,
int  port 
)

Connect the socket to an address.

Parameters
addressThe address to which we will connect.
portThe port number to use for the connection.

Definition at line 95 of file osocket_stream.tpp.

template<typename CharT , typename Traits >
void claw::net::basic_osocket_stream< CharT, Traits >::open ( int  fd)

Link the socket to a file descriptor.

Parameters
fdThe file descriptor.
Remarks
This method should be only called by claw::net::socket_server.

Definition at line 110 of file osocket_stream.tpp.


The documentation for this class was generated from the following files: