MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::osockstream Class Reference

#include <osockstream.hpp>

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

Public Member Functions

 osockstream (int port, const char *hostname)
 
int send ()
 
virtual ~osockstream ()
 
- Public Member Functions inherited from mfem::socketstream
 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 ()
 

Additional Inherited Members

- Static Public Attributes inherited from mfem::socketstream
static const bool secure_default = true
 
- Protected Member Functions inherited from mfem::socketstream
void set_socket (bool secure)
 
void check_secure_socket ()
 
void set_secure_socket (const GnuTLS_session_params &p)
 
- Static Protected Member Functions inherited from mfem::socketstream
static GnuTLS_session_paramsadd_socket ()
 
static void remove_socket ()
 
- Protected Attributes inherited from mfem::socketstream
socketbufbuf__
 
bool glvis_client
 
- Static Protected Attributes inherited from mfem::socketstream
static int num_glvis_sockets = 0
 
static GnuTLS_global_statestate = NULL
 
static GnuTLS_session_paramsparams = NULL
 

Detailed Description

Data type for output socket stream class. The class is used as client to send data to a server on a specified port number. One object of the class can be used for one time send of data to the server. The user writes in the stream, as in any other output stream and when the data is ready to be send function send() has to be executed. Otherwise (if not executed) the destructor will send the data.

Deprecated
This class is DEPRECATED. New code should use class socketstream (see socketstream.hpp).

Definition at line 28 of file osockstream.hpp.

Constructor & Destructor Documentation

◆ osockstream()

mfem::osockstream::osockstream ( int port,
const char * hostname )

The constructor takes as input the name of the server and the port number through which the communication will take place.

Definition at line 18 of file osockstream.cpp.

◆ ~osockstream()

virtual mfem::osockstream::~osockstream ( )
inlinevirtual

Virtual destructor. If the data hasn't been sent it sends it.

Definition at line 42 of file osockstream.hpp.

Member Function Documentation

◆ send()

int mfem::osockstream::send ( )
inline

Send the current in the stream data to the server specified by name "hostname" (in the constructor) on port number "port". Return -1 if data has already been sent or 0 for success.

Definition at line 39 of file osockstream.hpp.


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