#include <connectionlistener.h>
Public Types | |
enum | Error { AddressInUseError, UnknownError = -1 } |
Signals | |
void | newConnection (MoleQueue::Connection *connection) |
void | connectionError (MoleQueue::ConnectionListener::Error errorCode, const QString &message) |
Public Member Functions | |
ConnectionListener (QObject *parentObject=0) | |
virtual void | start ()=0 |
virtual void | stop (bool force)=0 |
virtual void | stop ()=0 |
virtual QString | connectionString () const =0 |
The ConnectionListener class is an interface defining a listener waiting for connection to a server. Implementations should emit the () signal. Subclasses provide concrete implements for example based on local sockets.
<molequeue/servercore/connectionlistener.h>
enum Error |
Defines the errors that will be emitted by ()
ConnectionListener | ( | QObject * | parentObject = 0 | ) |
Constructor.
parentObject | parent |
|
pure virtual |
Start the connection listener, start listening for incoming connections.
Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.
|
pure virtual |
Stop the connection listener.
force | if true, "extreme" measures may be taken to stop the listener. |
Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.
|
pure virtual |
Stop the connection listener without forcing it, equivalent to stop(false)
Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.
|
pure virtual |
Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.
|
signal |
Emitted when a new connection is received. The new connection is only valid for the lifetime of the connection listener instance that emitted it.
The | new connection. |
|
signal |
Emitted when an error occurs.
errorCore | The error code |
message | The error message provided by the implementation. |