API Documentation
Loading...
Searching...
No Matches
SocketConnection Class Reference

A core ConnectionBackend for QAbstractSocket supporting TCP and UDP connections. More...

#include <SocketConnection.h>

Inheritance diagram for SocketConnection:
[legend]
Collaboration diagram for SocketConnection:
[legend]

Public Member Functions

virtual uint04 bytesAvailable () const override
 
virtual void close () final override
 
virtual bool isOpen () const final override
 
virtual TranslatedString lastError () const final override
 
virtual bool open (const ConnectionInfo &request) final override
 
bool openTCP (const ConnectionInfo &request)
 
bool openUDP (const ConnectionInfo &request)
 
bool openUDPServer (const ConnectionInfo &request)
 
virtual uint04 peek (char *, uint04 size) const final override
 
virtual uint04 rx (char *, uint04 size=Constant< uint04 >::Max) final override
 
void setSocket (QAbstractSocket *socket)
 
virtual bool setTCPPort (QTcpSocket *tcp_port, ConnectionOpenType connect_mode)
 
virtual bool setUDPPort (QUdpSocket *udp_port, ConnectionOpenType connect_mode)
 
 SocketConnection (ProgressInfo *log)
 
virtual void tx (const String &command) final override
 
virtual bool waitForConnection (QAbstractSocket *socket, const ConnectionInfo &request)
 
virtual bool waitForReadyRead (const TimeSpan &span) final override
 
 ~SocketConnection ()
 
- Public Member Functions inherited from ConnectionBackend
 ConnectionBackend (ProgressInfo *log)
 
virtual String threadID () const
 

Protected Slots

void handleSocketErrorSlot (int error)
 

Protected Attributes

uint02 m_broadcast_port = Constant<uint02>::Invalid
 
TranslatedString m_last_error
 
QAbstractSocket * m_socket = nullptr
 
- Protected Attributes inherited from ConnectionBackend
ProgressInfom_log
 

Additional Inherited Members

- Signals inherited from ConnectionBackend
void connectionStateChangedSignal (ConnectionState state)
 
void dataAvailableSignal ()
 

Detailed Description

A core ConnectionBackend for QAbstractSocket supporting TCP and UDP connections.


Constructor & Destructor Documentation

◆ SocketConnection()

◆ ~SocketConnection()

Member Function Documentation

◆ bytesAvailable()

virtual uint04 bytesAvailable ( ) const
overridevirtual

Implements ConnectionBackend.

◆ close()

virtual void close ( )
finaloverridevirtual

Implements ConnectionBackend.

◆ handleSocketErrorSlot

void handleSocketErrorSlot ( int error)
protectedslot

◆ isOpen()

virtual bool isOpen ( ) const
finaloverridevirtual

Implements ConnectionBackend.

◆ lastError()

virtual TranslatedString lastError ( ) const
finaloverridevirtual

Implements ConnectionBackend.

◆ open()

virtual bool open ( const ConnectionInfo & request)
finaloverridevirtual

Implements ConnectionBackend.

◆ openTCP()

bool openTCP ( const ConnectionInfo & request)

◆ openUDP()

bool openUDP ( const ConnectionInfo & request)

◆ openUDPServer()

bool openUDPServer ( const ConnectionInfo & request)

◆ peek()

virtual uint04 peek ( char * ,
uint04 size ) const
finaloverridevirtual

Implements ConnectionBackend.

◆ rx()

virtual uint04 rx ( char * ,
uint04 size = Constantuint04 >::Max )
finaloverridevirtual

Implements ConnectionBackend.

◆ setSocket()

void setSocket ( QAbstractSocket * socket)

◆ setTCPPort()

virtual bool setTCPPort ( QTcpSocket * tcp_port,
ConnectionOpenType connect_mode )
virtual

◆ setUDPPort()

virtual bool setUDPPort ( QUdpSocket * udp_port,
ConnectionOpenType connect_mode )
virtual

◆ tx()

virtual void tx ( const String & command)
finaloverridevirtual

Implements ConnectionBackend.

◆ waitForConnection()

virtual bool waitForConnection ( QAbstractSocket * socket,
const ConnectionInfo & request )
virtual

◆ waitForReadyRead()

virtual bool waitForReadyRead ( const TimeSpan & span)
finaloverridevirtual

Implements ConnectionBackend.

Member Data Documentation

◆ m_broadcast_port

uint02 m_broadcast_port = Constant<uint02>::Invalid
protected

◆ m_last_error

TranslatedString m_last_error
protected

◆ m_socket

QAbstractSocket* m_socket = nullptr
protected

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