Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::SocketConnection Class Referenceabstract

#include <cxSocketConnection.h>

Inheritance diagram for cx::SocketConnection:
cx::NetworkConnection

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 ()
 

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...
 

Protected Member Functions

virtual void setProtocol (QString protocolname)=0
 
SocketConnectorPtr createConnector (ConnectionInfo info)
 
bool socketIsConnected ()
 
bool enoughBytesAvailableOnSocket (int bytes) const
 
bool socketReceive (void *packPointer, int packSize) 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 75 of file cxSocketConnection.h.

Constructor & Destructor Documentation

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

Definition at line 85 of file cxSocketConnection.cpp.

Member Function Documentation

CX_SOCKETCONNECTION_STATE cx::SocketConnection::computeState ( )
protected

Definition at line 239 of file cxSocketConnection.cpp.

void cx::SocketConnection::connected ( )
signal
void cx::SocketConnection::connectionInfoChanged ( )
signal
SocketConnectorPtr cx::SocketConnection::createConnector ( ConnectionInfo  info)
protected

Definition at line 154 of file cxSocketConnection.cpp.

void cx::SocketConnection::disconnected ( )
signal
bool cx::SocketConnection::enoughBytesAvailableOnSocket ( int  bytes) const
protected

Definition at line 216 of file cxSocketConnection.cpp.

void cx::SocketConnection::error ( )
signal
QStringList cx::SocketConnection::getAllServerHostnames ( )
protected
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 107 of file cxSocketConnection.cpp.

CX_SOCKETCONNECTION_STATE cx::SocketConnection::getState ( )

thread-safe

Definition at line 139 of file cxSocketConnection.cpp.

void cx::SocketConnection::requestConnect ( )
virtual

not thread-safe: use invoke

Definition at line 144 of file cxSocketConnection.cpp.

void cx::SocketConnection::requestDisconnect ( )
virtual

not thread-safe: use invoke

Definition at line 167 of file cxSocketConnection.cpp.

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

not thread-safe

Definition at line 179 of file cxSocketConnection.cpp.

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

thread-safe

Definition at line 113 of file cxSocketConnection.cpp.

void cx::SocketConnection::setCurrentConnectionInfo ( )
protected
virtual void cx::SocketConnection::setProtocol ( QString  protocolname)
protectedpure virtual

Implemented in cx::NetworkConnection.

bool cx::SocketConnection::socketIsConnected ( )
protected

Definition at line 211 of file cxSocketConnection.cpp.

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

Definition at line 224 of file cxSocketConnection.cpp.

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

Definition at line 124 of file cxSocketConnection.cpp.

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

Member Data Documentation

SocketConnectorPtr cx::SocketConnection::mConnector
protected

Definition at line 140 of file cxSocketConnection.h.

CX_SOCKETCONNECTION_STATE cx::SocketConnection::mCurrentState
protected

Definition at line 135 of file cxSocketConnection.h.

ConnectionInfo cx::SocketConnection::mNextConnectionInfo
protected

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

Definition at line 137 of file cxSocketConnection.h.

QMutex cx::SocketConnection::mNextConnectionInfoMutex
protected

Definition at line 136 of file cxSocketConnection.h.

QTcpSocket* cx::SocketConnection::mSocket
protected

Definition at line 133 of file cxSocketConnection.h.


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