VPTissue Reference Manual
SimPT_Parex::Connection Class Reference

Class managing a TCP stream of messages. More...

#include <Connection.h>

Inheritance diagram for SimPT_Parex::Connection:
Inheritance graph
Collaboration diagram for SimPT_Parex::Connection:
Collaboration graph

Public Slots

void SendMessage (const QByteArray &message)
 Sends a message over the connection. More...
 

Signals

void ConnectionClosed ()
 Signal emitted when the remote host closed the connection.
 
void Error (const std::string &error)
 Signal emitted when an error occurred in the connection. More...
 
void ReceivedMessage (const QByteArray &message)
 Signal emitted when a message is received over the connection. More...
 

Public Member Functions

 Connection (QTcpSocket *socket, QObject *parent=0)
 Constructor. More...
 
virtual ~Connection ()
 Destructor, closes the connection.
 
std::string GetPeerAddress () const
 
int GetPeerPort () const
 
bool IsConnected ()
 Check if still connected.
 

Detailed Description

Class managing a TCP stream of messages.

Definition at line 31 of file Connection.h.

Constructor & Destructor Documentation

SimPT_Parex::Connection::Connection ( QTcpSocket *  socket,
QObject parent = 0 
)

Constructor.

Parameters
socketThe connected TCP socket of this connection
parentThe parent of this QObject

Definition at line 31 of file Connection.cpp.

Member Function Documentation

void SimPT_Parex::Connection::Error ( const std::string &  error)
signal

Signal emitted when an error occurred in the connection.

Parameters
errorThe error message
void SimPT_Parex::Connection::ReceivedMessage ( const QByteArray &  message)
signal

Signal emitted when a message is received over the connection.

Parameters
messageThe received message
void SimPT_Parex::Connection::SendMessage ( const QByteArray &  message)
slot

Sends a message over the connection.

Parameters
messageThe message to be sent

Definition at line 63 of file Connection.cpp.

Referenced by SimPT_Parex::Protocol::SendPtree().

Here is the caller graph for this function:


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