MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Types | Signals | Public Member Functions | List of all members
ConnectionListener Class Referenceabstract

#include <connectionlistener.h>

Inheritance diagram for ConnectionListener:
LocalSocketConnectionListener ZeroMqConnectionListener

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
 

Detailed Description

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>

See Also
LocalSocketConnectionListener

Member Enumeration Documentation

enum Error

Defines the errors that will be emitted by ()

Constructor & Destructor Documentation

ConnectionListener ( QObject *  parentObject = 0)

Constructor.

Parameters
parentObjectparent

Member Function Documentation

virtual void start ( )
pure virtual

Start the connection listener, start listening for incoming connections.

Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.

virtual void stop ( bool  force)
pure virtual

Stop the connection listener.

Parameters
forceif true, "extreme" measures may be taken to stop the listener.

Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.

virtual void stop ( )
pure virtual

Stop the connection listener without forcing it, equivalent to stop(false)

See Also
stop(bool)

Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.

virtual QString connectionString ( ) const
pure virtual
Returns
the "address" the listener will listen on.

Implemented in LocalSocketConnectionListener, and ZeroMqConnectionListener.

void newConnection ( MoleQueue::Connection connection)
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.

Parameters
Thenew connection.
void connectionError ( MoleQueue::ConnectionListener::Error  errorCode,
const QString &  message 
)
signal

Emitted when an error occurs.

Parameters
errorCoreThe error code
See Also
Error
Parameters
messageThe error message provided by the implementation.

The documentation for this class was generated from the following file: