MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
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.
 
int detach ()
 Detach the current socket descriptor from the socketbuf.
 
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.
 
virtual int close ()
 Close the current socket descriptor.
 
int getsocketdescriptor ()
 Returns the attached socket descriptor.
 
bool is_open ()
 Returns true if the socket is open and has a valid socket descriptor. Otherwise returns false.
 
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

◆ socketbuf() [1/3]

mfem::socketbuf::socketbuf ( )
inline

Definition at line 39 of file socketstream.hpp.

◆ socketbuf() [2/3]

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

Definition at line 44 of file socketstream.hpp.

◆ socketbuf() [3/3]

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

Definition at line 50 of file socketstream.hpp.

◆ ~socketbuf()

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

Definition at line 77 of file socketstream.hpp.

Member Function Documentation

◆ attach()

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.

◆ close()

int mfem::socketbuf::close ( )
virtual

Close the current socket descriptor.

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 154 of file socketstream.cpp.

◆ detach()

int mfem::socketbuf::detach ( )
inline

Detach the current socket descriptor from the socketbuf.

Definition at line 61 of file socketstream.hpp.

◆ getsocketdescriptor()

int mfem::socketbuf::getsocketdescriptor ( )
inline

Returns the attached socket descriptor.

Definition at line 71 of file socketstream.hpp.

◆ is_open()

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.

◆ open()

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.

◆ overflow()

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

Definition at line 213 of file socketstream.cpp.

◆ sync()

int mfem::socketbuf::sync ( )
protectedvirtual

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 166 of file socketstream.cpp.

◆ underflow()

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

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 192 of file socketstream.cpp.

◆ xsgetn()

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

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 228 of file socketstream.cpp.

◆ xsputn()

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

Reimplemented in mfem::GnuTLS_socketbuf.

Definition at line 262 of file socketstream.cpp.

Member Data Documentation

◆ buflen

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

Definition at line 35 of file socketstream.hpp.

◆ ibuf

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

Definition at line 36 of file socketstream.hpp.

◆ obuf

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

Definition at line 36 of file socketstream.hpp.

◆ socket_descriptor

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: