Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ss::basic_socketbuf< _CharT, _Traits > Class Template Reference
[Socket Buffer]

The actual work of input and output (for sockets). More...

#include <basic_socketbuf.h>

Inheritance diagram for ss::basic_socketbuf< _CharT, _Traits >:

Inheritance graph
[legend]
Collaboration diagram for ss::basic_socketbuf< _CharT, _Traits >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::basic_streambuf<
char_type, traits_type
__streambuf_type
typedef basic_socketbuf< char_type,
traits_type
__socketbuf_type
typedef _CharT char_type
 These are standard types.
typedef _Traits traits_type
 These are standard types.
typedef traits_type::int_type int_type
 These are standard types.
typedef traits_type::pos_type pos_type
 These are standard types.
typedef traits_type::off_type off_type
 These are standard types.

Public Member Functions

 basic_socketbuf ()
 Default constructor.
 basic_socketbuf (sockets_base::family __f, sockets_base::style __s)
 Constructor.
virtual ~basic_socketbuf ()
 Destructor.
template<typename AddressT>
__socketbuf_typeconnect (AddressT &__addr)
 Connect to remote address.
bool is_open () const throw ()
 Checks if socket is open.
__socketbuf_typeshutdown (sockets_base::shutmode __mode=sockets_base::rw) throw ()
 Shut the socket down.
basic_socketsocket ()
 Return underlying socket.
sockets_base::flag setf (sockets_base::flag __f)
 Set I/O flags.

Protected Member Functions

 basic_socketbuf (basic_socket::descriptor_t descriptor)
 Constructor.
virtual int_type underflow ()
 Fetches more data from the connection.
virtual int_type uflow ()
 Fetches more data from the connection.
virtual int_type overflow (int_type __c=traits_type::eof())
 Consumes data from the buffer; writes to the connection.
virtual __streambuf_typesetbuf (char_type *__s, std::streamsize __n)
 Manipulates the buffer.
virtual int sync ()
 Synchronizes the buffer arrays with the controlled sequences.
virtual std::streamsize showmanyc ()
 Investigating the data available.
virtual int_type pbackfail (int_type=traits_type::eof())
 Tries to back up the input sequence.

Friends

class basic_socketstream

Detailed Description

template<typename _CharT, typename _Traits>
class ss::basic_socketbuf< _CharT, _Traits >

The actual work of input and output (for sockets).

This class maintains separate input and output sequences associated with a network socket.

Definition at line 50 of file basic_socketbuf.h.


Member Typedef Documentation

template<typename _CharT, typename _Traits>
typedef _CharT ss::basic_socketbuf< _CharT, _Traits >::char_type
 

These are standard types.

They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 63 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
typedef traits_type::int_type ss::basic_socketbuf< _CharT, _Traits >::int_type
 

These are standard types.

They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 66 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
typedef traits_type::off_type ss::basic_socketbuf< _CharT, _Traits >::off_type
 

These are standard types.

They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 68 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
typedef traits_type::pos_type ss::basic_socketbuf< _CharT, _Traits >::pos_type
 

These are standard types.

They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 67 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
typedef _Traits ss::basic_socketbuf< _CharT, _Traits >::traits_type
 

These are standard types.

They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 64 of file basic_socketbuf.h.


Constructor & Destructor Documentation

template<typename _CharT, typename _Traits>
ss::basic_socketbuf< _CharT, _Traits >::basic_socketbuf  )  [inline]
 

Default constructor.

Allocates a socket of default family and style.

Definition at line 82 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
ss::basic_socketbuf< _CharT, _Traits >::basic_socketbuf sockets_base::family  __f,
sockets_base::style  __s
[inline]
 

Constructor.

Parameters:
__f Socket family.
__s Socket style.
Allocates a socket of specified family and style.

Is there meaning in a style other than stream?

Definition at line 100 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
ss::basic_socketbuf< _CharT, _Traits >::basic_socketbuf basic_socket::descriptor_t  descriptor  )  [inline, protected]
 

Constructor.

Parameters:
descriptor Socket descriptor.
Constructs a socketbuf over an existing socket descriptor.

Definition at line 208 of file basic_socketbuf.h.


Member Function Documentation

template<typename _CharT, typename _Traits>
template<typename AddressT>
__socketbuf_type* ss::basic_socketbuf< _CharT, _Traits >::connect AddressT &  __addr  )  [inline]
 

Connect to remote address.

Returns:
this
This will attempt to connect at a remote (listening) socket bound to the specified address.

Definition at line 125 of file basic_socketbuf.h.

Referenced by ss::basic_osocketstream< _CharT, _Traits >::connect(), ss::basic_isocketstream< _CharT, _Traits >::connect(), and ss::basic_socketstream< _CharT, _Traits >::connect().

template<typename _CharT, typename _Traits>
virtual int_type ss::basic_socketbuf< _CharT, _Traits >::overflow int_type  __c = traits_type::eof()  )  [inline, protected, virtual]
 

Consumes data from the buffer; writes to the connection.

Parameters:
__c An additional character to consume.
Returns:
eof() to indicate failure, something else otherwise.
Informally, this function is called when the output buffer is full (or does not exist, as buffering need not actually be done). If a buffer exists, it is sent out to the connection. In either case, the character c is also sent out, if c is not eof().

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 301 of file basic_socketbuf.h.

Referenced by ss::basic_socketbuf< char_type, traits_type >::sync().

template<typename _CharT, typename _Traits>
virtual int_type ss::basic_socketbuf< _CharT, _Traits >::pbackfail int_type  = traits_type::eof()  )  [inline, protected, virtual]
 

Tries to back up the input sequence.

Parameters:
__c The character to be inserted back into the sequence.
Returns:
eof() on failure, or c on success.
Note: this method is not yet implemented, will always return eof.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 406 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
virtual __streambuf_type* ss::basic_socketbuf< _CharT, _Traits >::setbuf char_type __s,
std::streamsize  __n
[inline, protected, virtual]
 

Manipulates the buffer.

Parameters:
__s Array of characters.
__n Size of array.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 342 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
sockets_base::flag ss::basic_socketbuf< _CharT, _Traits >::setf sockets_base::flag  __f  )  [inline]
 

Set I/O flags.

Parameters:
__f I/O flags.

Definition at line 192 of file basic_socketbuf.h.

Referenced by ss::basic_isocketstream< _CharT, _Traits >::operator<<(), ss::basic_socketstream< _CharT, _Traits >::operator<<(), ss::basic_osocketstream< _CharT, _Traits >::operator>>(), and ss::basic_socketstream< _CharT, _Traits >::operator>>().

template<typename _CharT, typename _Traits>
virtual std::streamsize ss::basic_socketbuf< _CharT, _Traits >::showmanyc  )  [inline, protected, virtual]
 

Investigating the data available.

Returns:
An estimate of the number of characters available in the input sequence, or -1.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 384 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
__socketbuf_type* ss::basic_socketbuf< _CharT, _Traits >::shutdown sockets_base::shutmode  __mode = sockets_base::rw  )  throw () [inline]
 

Shut the socket down.

Returns:
this
This function fails immediately if the socket is not open.

This will close the connection with the peer for sending, receiving or both.

Definition at line 167 of file basic_socketbuf.h.

Referenced by ss::basic_osocketstream< _CharT, _Traits >::shutdown(), ss::basic_isocketstream< _CharT, _Traits >::shutdown(), and ss::basic_socketstream< _CharT, _Traits >::shutdown().

template<typename _CharT, typename _Traits>
basic_socket& ss::basic_socketbuf< _CharT, _Traits >::socket  )  [inline]
 

Return underlying socket.

Returns:
Socket.

Definition at line 181 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
virtual int_type ss::basic_socketbuf< _CharT, _Traits >::uflow  )  [inline, protected, virtual]
 

Fetches more data from the connection.

Returns:
The first character from the connection.
Informally, this function does the same thing as underflow(), and in fact is required to call that function. It also returns the new character, like underflow() does. However, this function also moves the read position forward by one.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 278 of file basic_socketbuf.h.

template<typename _CharT, typename _Traits>
virtual int_type ss::basic_socketbuf< _CharT, _Traits >::underflow  )  [inline, protected, virtual]
 

Fetches more data from the connection.

Returns:
The first character from the connection.
Informally, this function is called when the input buffer is exhausted (or does not exist, as buffering need not actually be done). If a buffer exists, it is "refilled". In either case, the next available character is returned, or traits::eof() to indicate a connection shutdown.

Reimplemented from std::basic_streambuf< _CharT, _Traits >.

Definition at line 229 of file basic_socketbuf.h.

Referenced by ss::basic_socketbuf< char_type, traits_type >::uflow().


The documentation for this class was generated from the following file:
Generated on Sat May 21 21:25:50 2005 for Socket Streams Library by  doxygen 1.4.3