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

#include <socketstream.hpp>

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

Public Member Functions

 socketstream (bool secure=secure_default)
 Create a socket stream without connecting to a host. More...
 
 socketstream (socketbuf *buf)
 Create a socket stream associated with the given socket buffer. The new object takes ownership of 'buf'. More...
 
 socketstream (int s, bool secure=secure_default)
 Create a socket stream and associate it with the given socket descriptor 's'. The treatment of the 'secure' flag is similar to that in the default constructor. More...
 
 socketstream (const char hostname[], int port, bool secure=secure_default)
 Create a socket stream and connect to the given host and port. The treatment of the 'secure' flag is similar to that in the default constructor. More...
 
 socketstream (const GnuTLS_session_params &p)
 Create a secure socket stream using the given GnuTLS_session_params. More...
 
socketbufrdbuf ()
 
int open (const char hostname[], int port)
 
int close ()
 
bool is_open ()
 
virtual ~socketstream ()
 

Static Public Attributes

static const bool secure_default = true
 

Protected Member Functions

void set_socket (bool secure)
 
void check_secure_socket ()
 
void set_secure_socket (const GnuTLS_session_params &p)
 

Static Protected Member Functions

static GnuTLS_session_paramsadd_socket ()
 
static void remove_socket ()
 

Protected Attributes

socketbufbuf__
 
bool glvis_client
 

Static Protected Attributes

static int num_glvis_sockets = 0
 
static GnuTLS_global_statestate = NULL
 
static GnuTLS_session_paramsparams = NULL
 

Detailed Description

Definition at line 203 of file socketstream.hpp.

Constructor & Destructor Documentation

mfem::socketstream::socketstream ( bool  secure = secure_default)

Create a socket stream without connecting to a host.

If 'secure' is true, (GnuTLS support must be enabled) then the connection will use GLVis client session keys from ~/.config/glvis/client for GnuTLS identification. If you want to use other GnuTLS session keys or parameters, use the constructor from GnuTLS_session_params.

Definition at line 995 of file socketstream.cpp.

mfem::socketstream::socketstream ( socketbuf buf)
inlineexplicit

Create a socket stream associated with the given socket buffer. The new object takes ownership of 'buf'.

Definition at line 237 of file socketstream.hpp.

mfem::socketstream::socketstream ( int  s,
bool  secure = secure_default 
)
explicit

Create a socket stream and associate it with the given socket descriptor 's'. The treatment of the 'secure' flag is similar to that in the default constructor.

Definition at line 1001 of file socketstream.cpp.

mfem::socketstream::socketstream ( const char  hostname[],
int  port,
bool  secure = secure_default 
)
inline

Create a socket stream and connect to the given host and port. The treatment of the 'secure' flag is similar to that in the default constructor.

Definition at line 248 of file socketstream.hpp.

mfem::socketstream::socketstream ( const GnuTLS_session_params p)
explicit

Create a secure socket stream using the given GnuTLS_session_params.

Definition at line 959 of file socketstream.cpp.

mfem::socketstream::~socketstream ( )
virtual

Definition at line 1022 of file socketstream.cpp.

Member Function Documentation

GnuTLS_session_params & mfem::socketstream::add_socket ( )
staticprotected

Definition at line 904 of file socketstream.cpp.

void mfem::socketstream::check_secure_socket ( )
inlineprotected

Definition at line 987 of file socketstream.cpp.

int mfem::socketstream::close ( )
inline

Definition at line 260 of file socketstream.hpp.

bool mfem::socketstream::is_open ( )
inline

Definition at line 262 of file socketstream.hpp.

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

Definition at line 1008 of file socketstream.cpp.

socketbuf* mfem::socketstream::rdbuf ( )
inline

Definition at line 256 of file socketstream.hpp.

void mfem::socketstream::remove_socket ( )
staticprotected

Definition at line 940 of file socketstream.cpp.

void mfem::socketstream::set_secure_socket ( const GnuTLS_session_params p)
inlineprotected

Definition at line 953 of file socketstream.cpp.

void mfem::socketstream::set_socket ( bool  secure)
protected

Definition at line 968 of file socketstream.cpp.

Member Data Documentation

socketbuf* mfem::socketstream::buf__
protected

Definition at line 206 of file socketstream.hpp.

bool mfem::socketstream::glvis_client
protected

Definition at line 207 of file socketstream.hpp.

int mfem::socketstream::num_glvis_sockets = 0
staticprotected

Definition at line 212 of file socketstream.hpp.

GnuTLS_session_params * mfem::socketstream::params = NULL
staticprotected

Definition at line 214 of file socketstream.hpp.

static const bool mfem::socketstream::secure_default = true
static

Definition at line 222 of file socketstream.hpp.

GnuTLS_global_state * mfem::socketstream::state = NULL
staticprotected

Definition at line 213 of file socketstream.hpp.


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