NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cx::SocketConnection Class Reference

#include <cxSocketConnection.h>

Inheritance diagram for cx::SocketConnection:

Classes

struct  ConnectionInfo
 

Public Slots

bool sendData (const char *data, qint64 maxSize)
 not thread-safe More...
 

Signals

void connectionInfoChanged ()
 
void stateChanged (CX_SOCKETCONNECTION_STATE status)
 
void connected ()
 
void disconnected ()
 
void error ()
 
void dataAvailable ()
 

Public Member Functions

 SocketConnection (QObject *parent=0)
 
ConnectionInfo getConnectionInfo ()
 thread-safe More...
 
CX_SOCKETCONNECTION_STATE getState ()
 thread-safe More...
 
virtual void setConnectionInfo (ConnectionInfo info)
 thread-safe More...
 
virtual void requestConnect ()
 not thread-safe: use invoke More...
 
virtual void requestDisconnect ()
 not thread-safe: use invoke More...
 
bool socketReceive (void *packPointer, int packSize) const
 

Protected Member Functions

virtual void setProtocol (QString protocolname)
 
SocketConnectorPtr createConnector (ConnectionInfo info)
 
bool socketIsConnected ()
 
bool enoughBytesAvailableOnSocket (int bytes) const
 
QStringList getAllServerHostnames ()
 
void setCurrentConnectionInfo ()
 
void stateChange (CX_SOCKETCONNECTION_STATE newState)
 
CX_SOCKETCONNECTION_STATE computeState ()
 

Protected Attributes

QTcpSocket * mSocket
 
CX_SOCKETCONNECTION_STATE mCurrentState
 
QMutex mNextConnectionInfoMutex
 
ConnectionInfo mNextConnectionInfo
 info to be used for the next connect(), mutexed. More...
 
SocketConnectorPtr mConnector
 

Detailed Description

Definition at line 55 of file cxSocketConnection.h.

Constructor & Destructor Documentation

◆ SocketConnection()

cx::SocketConnection::SocketConnection ( QObject *  parent = 0)
explicit

Definition at line 64 of file cxSocketConnection.cpp.

Member Function Documentation

◆ computeState()

CX_SOCKETCONNECTION_STATE cx::SocketConnection::computeState ( )
protected

Definition at line 230 of file cxSocketConnection.cpp.

◆ connected

void cx::SocketConnection::connected ( )
signal

◆ connectionInfoChanged

void cx::SocketConnection::connectionInfoChanged ( )
signal

◆ createConnector()

SocketConnectorPtr cx::SocketConnection::createConnector ( ConnectionInfo  info)
protected

Definition at line 134 of file cxSocketConnection.cpp.

◆ dataAvailable

void cx::SocketConnection::dataAvailable ( )
signal

◆ disconnected

void cx::SocketConnection::disconnected ( )
signal

◆ enoughBytesAvailableOnSocket()

bool cx::SocketConnection::enoughBytesAvailableOnSocket ( int  bytes) const
protected

Definition at line 207 of file cxSocketConnection.cpp.

◆ error

void cx::SocketConnection::error ( )
signal

◆ getAllServerHostnames()

QStringList cx::SocketConnection::getAllServerHostnames ( )
protected

◆ getConnectionInfo()

SocketConnection::ConnectionInfo cx::SocketConnection::getConnectionInfo ( )

thread-safe

Return the connection info for the next connection. Any existing connection might have other values.

Definition at line 87 of file cxSocketConnection.cpp.

◆ getState()

CX_SOCKETCONNECTION_STATE cx::SocketConnection::getState ( )

thread-safe

Definition at line 119 of file cxSocketConnection.cpp.

◆ requestConnect()

void cx::SocketConnection::requestConnect ( )
virtual

not thread-safe: use invoke

Definition at line 124 of file cxSocketConnection.cpp.

◆ requestDisconnect()

void cx::SocketConnection::requestDisconnect ( )
virtual

not thread-safe: use invoke

Definition at line 147 of file cxSocketConnection.cpp.

◆ sendData

bool cx::SocketConnection::sendData ( const char *  data,
qint64  maxSize 
)
slot

not thread-safe

Definition at line 159 of file cxSocketConnection.cpp.

◆ setConnectionInfo()

void cx::SocketConnection::setConnectionInfo ( ConnectionInfo  info)
virtual

thread-safe

Definition at line 93 of file cxSocketConnection.cpp.

◆ setCurrentConnectionInfo()

void cx::SocketConnection::setCurrentConnectionInfo ( )
protected

◆ setProtocol()

void cx::SocketConnection::setProtocol ( QString  protocolname)
protectedvirtual

Definition at line 197 of file cxSocketConnection.cpp.

◆ socketIsConnected()

bool cx::SocketConnection::socketIsConnected ( )
protected

Definition at line 202 of file cxSocketConnection.cpp.

◆ socketReceive()

bool cx::SocketConnection::socketReceive ( void *  packPointer,
int  packSize 
) const

Definition at line 215 of file cxSocketConnection.cpp.

◆ stateChange()

void cx::SocketConnection::stateChange ( CX_SOCKETCONNECTION_STATE  newState)
protected

Definition at line 104 of file cxSocketConnection.cpp.

◆ stateChanged

void cx::SocketConnection::stateChanged ( CX_SOCKETCONNECTION_STATE  status)
signal

Member Data Documentation

◆ mConnector

SocketConnectorPtr cx::SocketConnection::mConnector
protected

Definition at line 122 of file cxSocketConnection.h.

◆ mCurrentState

CX_SOCKETCONNECTION_STATE cx::SocketConnection::mCurrentState
protected

Definition at line 117 of file cxSocketConnection.h.

◆ mNextConnectionInfo

ConnectionInfo cx::SocketConnection::mNextConnectionInfo
protected

info to be used for the next connect(), mutexed.

Definition at line 119 of file cxSocketConnection.h.

◆ mNextConnectionInfoMutex

QMutex cx::SocketConnection::mNextConnectionInfoMutex
protected

Definition at line 118 of file cxSocketConnection.h.

◆ mSocket

QTcpSocket* cx::SocketConnection::mSocket
protected

Definition at line 115 of file cxSocketConnection.h.


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