class for listening to incoming network connections.
More...
#include <networklistener.h>
class for listening to incoming network connections.
This class will spawn a Connection for each received network connection.
◆ NetworkListener()
Constructor
- Parameters
-
aController | application controller for app state frobnication |
aModel | data model reference for data storage |
aIpv6 | if set to true, this class will listen in Ipv6 instead of v4 and will not enumerate local network interfaces. |
◆ ~NetworkListener()
NetworkListener::~NetworkListener |
( |
| ) |
|
◆ broadCastReceived
void NetworkListener::broadCastReceived |
( |
| ) |
|
|
privateslot |
◆ connectionAttemptFailed
void NetworkListener::connectionAttemptFailed |
( |
const Hash & |
aNodeHash | ) |
|
|
privateslot |
This slot is used to communicate situation where connection-attempt to node fails
- Parameters
-
aNodeHash | fingerprint of failed node |
◆ connectionClosed()
virtual void NetworkListener::connectionClosed |
( |
Connection * |
aDeletee | ) |
|
|
virtual |
◆ connectionReady()
virtual void NetworkListener::connectionReady |
( |
Connection * |
aBusinessEntity | ) |
|
|
virtual |
◆ dataReceived()
virtual bool NetworkListener::dataReceived |
( |
const QByteArray & |
aData, |
|
|
Connection & |
aConnection |
|
) |
| |
|
virtual |
◆ error
void NetworkListener::error |
( |
QTcpSocket::SocketError |
socketError | ) |
|
|
signal |
◆ figureOutLocalAddresses()
void NetworkListener::figureOutLocalAddresses |
( |
| ) |
|
Method that loops network interfaces and tries to find a valid local address to advertise
◆ incomingConnection()
void NetworkListener::incomingConnection |
( |
int |
aSocketDescriptor | ) |
|
|
protected |
◆ networkStateChanged
void NetworkListener::networkStateChanged |
( |
QNetworkSession::State |
aState | ) |
|
|
privateslot |
◆ nodeConnectionAttemptStatus
this signal is used to communicate (at least to publishing engine) status of connection attempt to particular node. network connection engine will spawn connections to more-or-less random nodes but publishing logic may ask for connections to specific nodes. this signal will communicate outcome of such requests
◆ startListen()
bool NetworkListener::startListen |
( |
bool |
aIpv6 | ) |
|
separate method for starting the listen. this now works with qt4.8 but it seems like semantics of listen may change in qt5, where listening in QHostAddress::Any automatically means both v4 and v6.
- Parameters
-
aIpv6 | if true, tries to listen on both IPv6 and ipv4. |
- Returns
- true if listening started.
◆ stopAccepting()
void NetworkListener::stopAccepting |
( |
| ) |
|
used in closing of app: stops accepting connections
◆ threadIsDeleted
void NetworkListener::threadIsDeleted |
( |
| ) |
|
|
privateslot |
◆ iBroadCastListener
QUdpSocket NetworkListener::iBroadCastListener |
|
private |
◆ iCanAccept
bool NetworkListener::iCanAccept |
|
private |
used in closing of application: flag for not accepting connections any more
◆ iConnectionConfig
QNetworkConfiguration NetworkListener::iConnectionConfig |
|
private |
◆ iController
◆ iModel
Model* NetworkListener::iModel |
|
private |
◆ iNetworkSession
QNetworkSession* NetworkListener::iNetworkSession |
|
private |
◆ iParser
This animal here knows all incoming bytearrays
The documentation for this class was generated from the following file: