MFEM v2.0
Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
socketbuf Class Reference

#include <socketstream.hpp>

List of all members.

Public Member Functions

 socketbuf ()
 socketbuf (int sd)
 socketbuf (const char hostname[], int port)
int attach (int sd)
int detach ()
int open (const char hostname[], int port)
int close ()
int getsocketdescriptor ()
bool is_open ()
 ~socketbuf ()

Protected Member Functions

virtual int sync ()
virtual int_type underflow ()
virtual int_type overflow (int_type c=traits_type::eof())
virtual std::streamsize xsgetn (char_type *__s, std::streamsize __n)
virtual std::streamsize xsputn (const char_type *__s, std::streamsize __n)

Private Attributes

int socket_descriptor
char ibuf [buflen]
char obuf [buflen]

Static Private Attributes

static const int buflen = 1024

Detailed Description

Definition at line 17 of file socketstream.hpp.


Constructor & Destructor Documentation

socketbuf::socketbuf ( ) [inline]

Definition at line 25 of file socketstream.hpp.

References socket_descriptor.

socketbuf::socketbuf ( int  sd) [inline, explicit]

Definition at line 30 of file socketstream.hpp.

References buflen, obuf, and socket_descriptor.

socketbuf::socketbuf ( const char  hostname[],
int  port 
) [inline]

Definition at line 36 of file socketstream.hpp.

References open(), and socket_descriptor.

socketbuf::~socketbuf ( ) [inline]

Definition at line 56 of file socketstream.hpp.

References close().


Member Function Documentation

int socketbuf::attach ( int  sd)

Attach a new socket descriptor to the socketbuf. Returns the old socket descriptor which is NOT closed.

Definition at line 21 of file socketstream.cpp.

References buflen, obuf, and socket_descriptor.

Referenced by socketserver::accept(), and detach().

int socketbuf::close ( )

Definition at line 63 of file socketstream.cpp.

References is_open(), and socket_descriptor.

Referenced by socketserver::accept(), socketstream::close(), open(), and ~socketbuf().

int socketbuf::detach ( ) [inline]

Definition at line 46 of file socketstream.hpp.

References attach().

int socketbuf::getsocketdescriptor ( ) [inline]

Definition at line 52 of file socketstream.hpp.

References socket_descriptor.

bool socketbuf::is_open ( ) [inline]

Definition at line 54 of file socketstream.hpp.

References socket_descriptor.

Referenced by close(), and socketstream::is_open().

int socketbuf::open ( const char  hostname[],
int  port 
)

Definition at line 31 of file socketstream.cpp.

References buflen, close(), obuf, and socket_descriptor.

Referenced by socketstream::open(), and socketbuf().

socketbuf::int_type socketbuf::overflow ( int_type  c = traits_type::eof()) [protected, virtual]

Definition at line 113 of file socketstream.cpp.

References sync().

int socketbuf::sync ( ) [protected, virtual]

Definition at line 75 of file socketstream.cpp.

References buflen, obuf, and socket_descriptor.

Referenced by overflow(), and xsputn().

socketbuf::int_type socketbuf::underflow ( ) [protected, virtual]

Definition at line 98 of file socketstream.cpp.

References buflen, ibuf, and socket_descriptor.

std::streamsize socketbuf::xsgetn ( char_type *  __s,
std::streamsize  __n 
) [protected, virtual]

Definition at line 124 of file socketstream.cpp.

References socket_descriptor.

std::streamsize socketbuf::xsputn ( const char_type *  __s,
std::streamsize  __n 
) [protected, virtual]

Definition at line 150 of file socketstream.cpp.

References buflen, socket_descriptor, and sync().


Member Data Documentation

const int socketbuf::buflen = 1024 [static, private]

Definition at line 21 of file socketstream.hpp.

Referenced by attach(), open(), socketbuf(), sync(), underflow(), and xsputn().

char socketbuf::ibuf[buflen] [private]

Definition at line 22 of file socketstream.hpp.

Referenced by underflow().

char socketbuf::obuf[buflen] [private]

Definition at line 22 of file socketstream.hpp.

Referenced by attach(), open(), socketbuf(), and sync().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines