MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
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.
 
 socketstream (socketbuf *buf)
 Create a socket stream associated with the given socket buffer. The new object takes ownership of 'buf'.
 
 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.
 
 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.
 
 socketstream (const GnuTLS_session_params &p)
 Create a secure socket stream using the given GnuTLS_session_params.
 
socketbufrdbuf ()
 
int open (const char hostname[], int port)
 Open the socket stream on 'port' at 'hostname'.
 
int close ()
 Close the socketstream.
 
bool is_open ()
 True if the socketstream is open, false otherwise.
 
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 210 of file socketstream.hpp.

Constructor & Destructor Documentation

◆ socketstream() [1/5]

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 1045 of file socketstream.cpp.

◆ socketstream() [2/5]

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 244 of file socketstream.hpp.

◆ socketstream() [3/5]

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 1051 of file socketstream.cpp.

◆ socketstream() [4/5]

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 255 of file socketstream.hpp.

◆ socketstream() [5/5]

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

Create a secure socket stream using the given GnuTLS_session_params.

Definition at line 1009 of file socketstream.cpp.

◆ ~socketstream()

mfem::socketstream::~socketstream ( )
virtual

Definition at line 1072 of file socketstream.cpp.

Member Function Documentation

◆ add_socket()

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

Definition at line 954 of file socketstream.cpp.

◆ check_secure_socket()

void mfem::socketstream::check_secure_socket ( )
inlineprotected

Definition at line 1037 of file socketstream.cpp.

◆ close()

int mfem::socketstream::close ( )
inline

Close the socketstream.

Definition at line 269 of file socketstream.hpp.

◆ is_open()

bool mfem::socketstream::is_open ( )
inline

True if the socketstream is open, false otherwise.

Definition at line 272 of file socketstream.hpp.

◆ open()

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

Open the socket stream on 'port' at 'hostname'.

Definition at line 1058 of file socketstream.cpp.

◆ rdbuf()

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

Definition at line 263 of file socketstream.hpp.

◆ remove_socket()

void mfem::socketstream::remove_socket ( )
staticprotected

Definition at line 990 of file socketstream.cpp.

◆ set_secure_socket()

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

Definition at line 1003 of file socketstream.cpp.

◆ set_socket()

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

Definition at line 1018 of file socketstream.cpp.

Member Data Documentation

◆ buf__

socketbuf* mfem::socketstream::buf__
protected

Definition at line 213 of file socketstream.hpp.

◆ glvis_client

bool mfem::socketstream::glvis_client
protected

Definition at line 214 of file socketstream.hpp.

◆ num_glvis_sockets

int mfem::socketstream::num_glvis_sockets = 0
staticprotected

Definition at line 219 of file socketstream.hpp.

◆ params

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

Definition at line 221 of file socketstream.hpp.

◆ secure_default

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

Definition at line 229 of file socketstream.hpp.

◆ state

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

Definition at line 220 of file socketstream.hpp.


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