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 |
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 |
( |
| ) |
|
|
private |
void NetworkListener::incomingConnection |
( |
int |
aSocketDescriptor | ) |
|
|
protected |
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
Model* NetworkListener::iModel |
|
private |
This animal here knows all incoming bytearrays
The documentation for this class was generated from the following file: