MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
mfem::socketbuf Class Reference

#include <socketstream.hpp>

Inheritance diagram for mfem::socketbuf:
[legend]
Collaboration diagram for mfem::socketbuf:
[legend]

Public Member Functions

 socketbuf ()
 
 socketbuf (int sd)
 
 socketbuf (const char hostname[], int port)
 
virtual int attach (int sd)
 Attach a new socket descriptor to the socketbuf. Returns the old socket descriptor which is NOT closed. More...
 
int detach ()
 Detach the current socket descriptor from the socketbuf. More...
 
virtual int open (const char hostname[], int port)
 Open a socket on the 'port' at 'hostname' and store the socket descriptor. Returns 0 if there is no error, otherwise returns -1. More...
 
virtual int close ()
 Close the current socket descriptor. More...
 
int getsocketdescriptor ()
 Returns the attached socket descriptor. More...
 
bool is_open ()
 Returns true if the socket is open and has a valid socket descriptor. Otherwise returns false. More...
 
virtual ~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__)
 

Protected Attributes

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

Static Protected Attributes

static const int buflen = 1024
 

Detailed Description

Definition at line 31 of file socketstream.hpp.

Constructor & Destructor Documentation

mfem::socketbuf::socketbuf ( )
inline

Definition at line 39 of file socketstream.hpp.

mfem::socketbuf::socketbuf ( int  sd)
inlineexplicit

Definition at line 44 of file socketstream.hpp.

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

Definition at line 50 of file socketstream.hpp.

virtual mfem::socketbuf::~socketbuf ( )
inlinevirtual

Definition at line 77 of file socketstream.hpp.

Member Function Documentation

int mfem::socketbuf::attach ( int  sd)
virtual

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

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 84 of file socketstream.cpp.

int mfem::socketbuf::close ( )
virtual

Close the current socket descriptor.

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 147 of file socketstream.cpp.

int mfem::socketbuf::detach ( )
inline

Detach the current socket descriptor from the socketbuf.

Definition at line 61 of file socketstream.hpp.

int mfem::socketbuf::getsocketdescriptor ( )
inline

Returns the attached socket descriptor.

Definition at line 71 of file socketstream.hpp.

bool mfem::socketbuf::is_open ( )
inline

Returns true if the socket is open and has a valid socket descriptor. Otherwise returns false.

Definition at line 75 of file socketstream.hpp.

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

Open a socket on the 'port' at 'hostname' and store the socket descriptor. Returns 0 if there is no error, otherwise returns -1.

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 94 of file socketstream.cpp.

socketbuf::int_type mfem::socketbuf::overflow ( int_type  c = traits_type::eof())
protectedvirtual

Definition at line 206 of file socketstream.cpp.

int mfem::socketbuf::sync ( )
protectedvirtual

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 159 of file socketstream.cpp.

socketbuf::int_type mfem::socketbuf::underflow ( )
protectedvirtual

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 185 of file socketstream.cpp.

std::streamsize mfem::socketbuf::xsgetn ( char_type *  s__,
std::streamsize  n__ 
)
protectedvirtual

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 221 of file socketstream.cpp.

std::streamsize mfem::socketbuf::xsputn ( const char_type *  s__,
std::streamsize  n__ 
)
protectedvirtual

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 255 of file socketstream.cpp.

Member Data Documentation

const int mfem::socketbuf::buflen = 1024
staticprotected

Definition at line 35 of file socketstream.hpp.

char mfem::socketbuf::ibuf[buflen]
protected

Definition at line 36 of file socketstream.hpp.

char mfem::socketbuf::obuf[buflen]
protected

Definition at line 36 of file socketstream.hpp.

int mfem::socketbuf::socket_descriptor
protected

Definition at line 34 of file socketstream.hpp.


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