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.
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 |
( |
| ) |
|
void NetworkListener::broadCastReceived |
( |
| ) |
|
|
privateslot |
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 |
virtual void NetworkListener::connectionClosed |
( |
Connection * |
aDeletee | ) |
|
|
virtual |
virtual void NetworkListener::connectionReady |
( |
Connection * |
aBusinessEntity | ) |
|
|
virtual |
virtual bool NetworkListener::dataReceived |
( |
const QByteArray & |
aData, |
|
|
Connection & |
aConnection |
|
) |
| |
|
virtual |
void NetworkListener::error |
( |
QTcpSocket::SocketError |
socketError | ) |
|
|
signal |
void NetworkListener::figureOutLocalAddresses |
( |
| ) |
|
Method that loops network interfaces and tries to find a valid local address to advertise
void NetworkListener::incomingConnection |
( |
int |
aSocketDescriptor | ) |
|
|
protected |
void NetworkListener::networkStateChanged |
( |
QNetworkSession::State |
aState | ) |
|
|
privateslot |
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
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.
void NetworkListener::stopAccepting |
( |
| ) |
|
used in closing of app: stops accepting connections
void NetworkListener::threadIsDeleted |
( |
| ) |
|
|
privateslot |
QUdpSocket NetworkListener::iBroadCastListener |
|
private |
bool NetworkListener::iCanAccept |
|
private |
used in closing of application: flag for not accepting connections any more
QNetworkConfiguration NetworkListener::iConnectionConfig |
|
private |
Model* NetworkListener::iModel |
|
private |
QNetworkSession* NetworkListener::iNetworkSession |
|
private |
This animal here knows all incoming bytearrays
The documentation for this class was generated from the following file: