Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QLocalServer Class Reference

Inheritance diagram for QLocalServer:


List of all members.

Detailed Description

The QLocalServer class provides a local socket based server.

This class makes it possible to accept incoming local socket connections.

Call listen() to have the server start listening for incoming connections on a specified key. The newConnection() signal is then emitted each time a client connects to the server.

Call nextPendingConnection() to accept the pending connection as a connected QLocalSocket. The function returns a pointer to a QLocalSocket that can be used for communicating with the client.

If an error occurs, serverError() returns the type of error, and errorString() can be called to get a human readable description of what happened.

When listening for connections, the name which the server is listening on is available through serverName().

Calling close() makes QLocalServer stop listening for incoming connections.

Although QLocalServer is designed for use with an event loop, it's possible to use it without one. In that case, you must use waitForNewConnection(), which blocks until either a connection is available or a timeout expires.

Note that this feature is not supported on Windows 9x.

See also:
QLocalSocket, QTcpServer

Definition at line 53 of file qlocalserver.h.

Public Slots

void deleteLater ()


void destroyed (QObject *=0)
void newConnection ()

Public Member Functions

bool blockSignals (bool b)
const QObjectListchildren () const
void close ()
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
QString errorString () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
template<typename T>
findChild (const QString &aName=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &aName=QString()) const
QString fullServerName () const
virtual bool hasPendingConnections () const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isListening () const
bool isWidgetType () const
void killTimer (int id)
bool listen (const QString &name)
int maxPendingConnections () const
void moveToThread (QThread *thread)
virtual QLocalSocketnextPendingConnection ()
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
 QLocalServer (QObject *parent=0)
void removeEventFilter (QObject *)
QAbstractSocket::SocketError serverError () const
QString serverName () const
void setMaxPendingConnections (int numConnections)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
QObjectUserData * userData (uint id) const
bool waitForNewConnection (int msec=0, bool *timedOut=0)
 ~QLocalServer ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()
static bool removeServer (const QString &name)

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
virtual void incomingConnection (quintptr socketDescriptor)
int receivers (const char *signal) const
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
qFindChildqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildren (const QObject *obj, const QString &name)
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QRegExp &regExp)()
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

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

Generated by  Doxygen 1.6.0   Back to index