MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
LocalSocketConnection Class Reference

#include <localsocketconnection.h>

Inheritance diagram for LocalSocketConnection:
Connection

Public Member Functions

 LocalSocketConnection (QObject *parentObject, QLocalSocket *socket)
 
 LocalSocketConnection (QObject *parentObject, const QString &connectionString)
 
 ~LocalSocketConnection ()
 
void open ()
 
void start ()
 
void close ()
 
bool isOpen ()
 
QString connectionString () const
 
bool send (const PacketType &packet, const EndpointIdType &endpoint)
 
void flush ()
 
- Public Member Functions inherited from Connection
 Connection (QObject *parentObject=0)
 

Additional Inherited Members

- Signals inherited from Connection
void packetReceived (const MoleQueue::PacketType &packet, const MoleQueue::EndpointIdType &endpoint)
 
void disconnected ()
 

Detailed Description

Provides am implementation of using QLocalSockets. Each instance of the class wraps a QLocalSocket.

<molequeue/servervcore/localsocketconnection.h>

Constructor & Destructor Documentation

LocalSocketConnection ( QObject *  parentObject,
QLocalSocket *  socket 
)
explicit

Constructor used by to create a new connection based on an existing QLocalSocket.

Parameters
parentObjectparent
socketThe socket that this connection instance will operate on.
LocalSocketConnection ( QObject *  parentObject,
const QString &  connectionString 
)
explicit

Constructor used by a client to connection to a server ( )

Parameters
parentObjectparent
connectionStringThe "address" of server to connect to.

Destructor.

Member Function Documentation

void open ( )
virtual

Opens the connection the server i.e. QLocalSocket::connectToServer(...)

See Also
Connection::open()

Implements Connection.

void start ( )
virtual

Start receiving messages on this connection.

See Also
Connection::start

Implements Connection.

void close ( )
virtual

Close the underlying socket. Once closed the connection can no longer be used to receive or send messages.

See Also
Connection::close()

Implements Connection.

bool isOpen ( )
virtual
Returns
true is connection is open, false otherwise.
See Also
Connection::isOpen()

Implements Connection.

QString connectionString ( ) const
virtual
Returns
The serverName from the underlying socket.
See Also
Connection::connectionString()

Implements Connection.

bool send ( const PacketType &  packet,
const EndpointIdType &  endpoint 
)
virtual

Send the packet on the connection to endpoint.

Implements Connection.

void flush ( )
virtual

Flush all pending messages to the other endpoint.

Implements Connection.


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