33 #ifndef CXSOCKETCONNECTION_H
34 #define CXSOCKETCONNECTION_H
40 #include "boost/shared_ptr.hpp"
58 #define assertRunningInObjectThread() \
60 if (QThread::currentThread()!=this->thread()) \
63 << QString("Method should be called in the object's thread [%1] only, current thread = [%2]") \
64 .arg(this->thread()->objectName()) \
65 .arg(QThread::currentThread()->objectName()); \
89 bool isServer()
const;
90 bool isClient()
const;
91 bool isLocalhostConnection()
const;
92 QString getDescription()
const;
103 virtual void requestConnect();
104 virtual void requestDisconnect();
107 bool sendData(
const char* data, qint64 maxSize);
110 void connectionInfoChanged();
117 void internalConnected();
118 void internalDisconnected();
119 void internalError(QAbstractSocket::SocketError socketError);
120 virtual void internalDataAvailable() = 0;
123 virtual void setProtocol(QString protocolname) = 0;
125 bool socketIsConnected();
126 bool enoughBytesAvailableOnSocket(
int bytes)
const;
127 bool socketReceive(
void *packPointer,
int packSize)
const;
128 QStringList getAllServerHostnames();
129 void setCurrentConnectionInfo();
145 #endif // CXSOCKETCONNECTION_H
CX_SOCKETCONNECTION_STATE
ConnectionInfo mNextConnectionInfo
info to be used for the next connect(), mutexed.
CX_SOCKETCONNECTION_STATE mCurrentState
SNW_DECLARE_ENUM_STRING_CONVERTERS(cx, CX_SOCKETCONNECTION_STATE)
QMutex mNextConnectionInfoMutex
boost::shared_ptr< class SocketConnector > SocketConnectorPtr
bool operator==(const RegistrationTransform &lhs, const RegistrationTransform &rhs)
SocketConnectorPtr mConnector