The Network class.
More...
#include <Network.h>
The Network class.
Serial Studio "driver" class to interact with UDP/TCP network ports.
◆ Network() [1/3]
IO::DataSources::Network::Network |
( |
| ) |
|
|
explicitprivate |
◆ Network() [2/3]
IO::DataSources::Network::Network |
( |
Network && |
| ) |
|
|
privatedelete |
◆ Network() [3/3]
IO::DataSources::Network::Network |
( |
const Network & |
| ) |
|
|
privatedelete |
◆ ~Network()
IO::DataSources::Network::~Network |
( |
| ) |
|
|
private |
◆ addressChanged
void IO::DataSources::Network::addressChanged |
( |
| ) |
|
|
signal |
◆ configurationOk()
bool IO::DataSources::Network::configurationOk |
( |
| ) |
const |
Returns true
if the port is greater than 0 and the host address is valid.
◆ defaultAddress()
static QString IO::DataSources::Network::defaultAddress |
( |
| ) |
|
|
inlinestatic |
◆ defaultTcpPort()
static quint16 IO::DataSources::Network::defaultTcpPort |
( |
| ) |
|
|
inlinestatic |
◆ defaultUdpLocalPort()
static quint16 IO::DataSources::Network::defaultUdpLocalPort |
( |
| ) |
|
|
inlinestatic |
◆ defaultUdpRemotePort()
static quint16 IO::DataSources::Network::defaultUdpRemotePort |
( |
| ) |
|
|
inlinestatic |
◆ disconnectDevice
void IO::DataSources::Network::disconnectDevice |
( |
| ) |
|
|
slot |
Disconnects the TCP/UDP sockets from the host
◆ instance()
Returns the only instance of this class
◆ lookup
void IO::DataSources::Network::lookup |
( |
const QString & |
host | ) |
|
|
slot |
Performs a DNS lookup for the given host name
◆ lookupActive()
bool IO::DataSources::Network::lookupActive |
( |
| ) |
const |
Returns true
if we are currently performing a DNS lookup
◆ lookupActiveChanged
void IO::DataSources::Network::lookupActiveChanged |
( |
| ) |
|
|
signal |
◆ lookupFinished
void IO::DataSources::Network::lookupFinished |
( |
const QHostInfo & |
info | ) |
|
|
privateslot |
Sets the host IP address when the lookup finishes. If the lookup fails, the error code/string shall be shown to the user in a messagebox.
◆ onErrorOccurred
void IO::DataSources::Network::onErrorOccurred |
( |
const QAbstractSocket::SocketError |
socketError | ) |
|
|
privateslot |
This function is called whenever a socket error occurs, it disconnects the socket from the host and displays the error in a message box.
◆ openNetworkPort()
QIODevice * IO::DataSources::Network::openNetworkPort |
( |
| ) |
|
Attempts to make a connection to the given host, port and TCP/UDP socket type.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ portChanged
void IO::DataSources::Network::portChanged |
( |
| ) |
|
|
signal |
◆ remoteAddress()
QString IO::DataSources::Network::remoteAddress |
( |
| ) |
const |
◆ setRemoteAddress
void IO::DataSources::Network::setRemoteAddress |
( |
const QString & |
address | ) |
|
|
slot |
Sets the IPv4 or IPv6 address specified by the input string representation
◆ setSocketType
void IO::DataSources::Network::setSocketType |
( |
const QAbstractSocket::SocketType |
type | ) |
|
|
slot |
Changes the socket type. Valid input values are:
QAbstractSocket::TcpSocket
QAbstractSocket::UdpSocket
QAbstractSocket::UnknownSocketType
◆ setSocketTypeIndex
void IO::DataSources::Network::setSocketTypeIndex |
( |
const int |
index | ) |
|
|
slot |
Changes the current socket type given an index of the list returned by the socketType()
function.
◆ setTcpPort
void IO::DataSources::Network::setTcpPort |
( |
const quint16 |
port | ) |
|
|
slot |
Changes the TCP socket's port
number
◆ setTcpSocket
void IO::DataSources::Network::setTcpSocket |
( |
| ) |
|
|
slot |
Instructs the module to communicate via a TCP socket.
◆ setUdpIgnoreFrameSequences
void IO::DataSources::Network::setUdpIgnoreFrameSequences |
( |
const bool |
ignore | ) |
|
|
slot |
If ignore is set to true
, then the IO::Manager
should not check for start/end frame sequences when an UDP datagram is received.
Otherwise, the IO::Manager
shall check for start/end sequences to identify incoming frames.
◆ setUdpLocalPort
void IO::DataSources::Network::setUdpLocalPort |
( |
const quint16 |
port | ) |
|
|
slot |
Changes the UDP socket's local port
number
◆ setUdpMulticast
void IO::DataSources::Network::setUdpMulticast |
( |
const bool |
enabled | ) |
|
|
slot |
Enables/Disables multicast connections with the UDP socket.
◆ setUdpRemotePort
void IO::DataSources::Network::setUdpRemotePort |
( |
const quint16 |
port | ) |
|
|
slot |
Changes the UDP socket's remote port
number
◆ setUdpSocket
void IO::DataSources::Network::setUdpSocket |
( |
| ) |
|
|
slot |
Instructs the module to communicate via an UDP socket.
◆ socketType()
QAbstractSocket::SocketType IO::DataSources::Network::socketType |
( |
| ) |
const |
Returns the socket type. Valid return values are:
QAbstractSocket::TcpSocket
QAbstractSocket::UdpSocket
QAbstractSocket::SctpSocket
QAbstractSocket::UnknownSocketType
◆ socketTypeChanged
void IO::DataSources::Network::socketTypeChanged |
( |
| ) |
|
|
signal |
◆ socketTypeIndex()
int IO::DataSources::Network::socketTypeIndex |
( |
| ) |
const |
Returns the current socket type as an index of the list returned by the socketType
function.
◆ socketTypes()
StringList IO::DataSources::Network::socketTypes |
( |
| ) |
const |
Returns a list with the available socket types
◆ tcpPort()
quint16 IO::DataSources::Network::tcpPort |
( |
| ) |
const |
Returns the TCP port number
◆ tcpSocket()
QTcpSocket * IO::DataSources::Network::tcpSocket |
( |
| ) |
|
|
inline |
◆ udpIgnoreFrameSequences()
bool IO::DataSources::Network::udpIgnoreFrameSequences |
( |
| ) |
const |
Returns true
if the IO::Manager
should not check for start/end frame sequences when an UDP datagram is received.
◆ udpIgnoreFrameSequencesChanged
void IO::DataSources::Network::udpIgnoreFrameSequencesChanged |
( |
| ) |
|
|
signal |
◆ udpLocalPort()
quint16 IO::DataSources::Network::udpLocalPort |
( |
| ) |
const |
Returns the UDP local port number
◆ udpMulticast()
bool IO::DataSources::Network::udpMulticast |
( |
| ) |
const |
Returns true
if the UDP socket is managing a multicasted connection.
◆ udpMulticastChanged
void IO::DataSources::Network::udpMulticastChanged |
( |
| ) |
|
|
signal |
◆ udpRemotePort()
quint16 IO::DataSources::Network::udpRemotePort |
( |
| ) |
const |
Returns the UDP remote port number
◆ udpSocket()
QUdpSocket * IO::DataSources::Network::udpSocket |
( |
| ) |
|
|
inline |
◆ m_address
QString IO::DataSources::Network::m_address |
|
private |
◆ m_hostExists
bool IO::DataSources::Network::m_hostExists |
|
private |
◆ m_lookupActive
bool IO::DataSources::Network::m_lookupActive |
|
private |
◆ m_socketType
QAbstractSocket::SocketType IO::DataSources::Network::m_socketType |
|
private |
◆ m_tcpPort
quint16 IO::DataSources::Network::m_tcpPort |
|
private |
◆ m_tcpSocket
QTcpSocket IO::DataSources::Network::m_tcpSocket |
|
private |
◆ m_udpIgnoreFrameSequences
bool IO::DataSources::Network::m_udpIgnoreFrameSequences |
|
private |
◆ m_udpLocalPort
quint16 IO::DataSources::Network::m_udpLocalPort |
|
private |
◆ m_udpMulticast
bool IO::DataSources::Network::m_udpMulticast |
|
private |
◆ m_udpRemotePort
quint16 IO::DataSources::Network::m_udpRemotePort |
|
private |
◆ m_udpSocket
QUdpSocket IO::DataSources::Network::m_udpSocket |
|
private |
◆ defaultAddress
QString IO::DataSources::Network::defaultAddress |
|
read |
◆ defaultTcpPort
quint16 IO::DataSources::Network::defaultTcpPort |
|
read |
◆ defaultUdpLocalPort
quint16 IO::DataSources::Network::defaultUdpLocalPort |
|
read |
◆ defaultUdpRemotePort
quint16 IO::DataSources::Network::defaultUdpRemotePort |
|
read |
◆ lookupActive
bool IO::DataSources::Network::lookupActive |
|
read |
◆ remoteAddress
QString IO::DataSources::Network::remoteAddress |
|
readwrite |
◆ socketType
QAbstractSocket::SocketType IO::DataSources::Network::socketType |
|
readwrite |
◆ socketTypeIndex
int IO::DataSources::Network::socketTypeIndex |
|
readwrite |
◆ socketTypes
◆ tcpPort
quint16 IO::DataSources::Network::tcpPort |
|
readwrite |
◆ udpIgnoreFrameSequences
bool IO::DataSources::Network::udpIgnoreFrameSequences |
|
readwrite |
◆ udpLocalPort
quint16 IO::DataSources::Network::udpLocalPort |
|
readwrite |
◆ udpMulticast
bool IO::DataSources::Network::udpMulticast |
|
readwrite |
◆ udpRemotePort
quint16 IO::DataSources::Network::udpRemotePort |
|
readwrite |
The documentation for this class was generated from the following files:
- /Users/alex/Documents/GitHub/Serial-Studio/src/IO/DataSources/Network.h
- /Users/alex/Documents/GitHub/Serial-Studio/src/IO/DataSources/Network.cpp