40class QLocalServerPrivate :
public QObjectPrivate
42 Q_DECLARE_PUBLIC(QLocalServer)
45 QLocalServerPrivate() :
46#if !defined(QT_LOCALSOCKET_TCP) && !defined(Q_OS_WIN)
47 listenSocket(-1), socketNotifier(
nullptr),
49 maxPendingConnections(30), error(QAbstractSocket::UnknownSocketError),
50 socketOptions(QLocalServer::NoOptions)
55 bool listen(
const QString &name);
56 bool listen(qintptr socketDescriptor);
57 static bool removeServer(
const QString &name);
59 void waitForNewConnection(
int msec,
bool *timedOut);
60 void _q_onNewConnection();
62#if defined(QT_LOCALSOCKET_TCP)
65 QMap<quintptr, QTcpSocket*> socketMap;
66#elif defined(Q_OS_WIN)
69 HANDLE handle =
nullptr;
70 OVERLAPPED overlapped;
71 bool connected =
false;
73 Q_DISABLE_COPY(Listener)
76 void setError(
const QString &function);
79 std::vector<std::unique_ptr<Listener>> listeners;
80 HANDLE eventHandle =
nullptr;
81 QWinEventNotifier *connectionEventNotifier;
83 void setError(
const QString &function);
86 QSocketNotifier *socketNotifier;
90 QString fullServerName;
91 int maxPendingConnections;
92 QQueue<QLocalSocket*> pendingConnections;
94 QAbstractSocket::SocketError error;
95 int listenBacklog = 50;
97 Q_OBJECT_BINDABLE_PROPERTY(QLocalServerPrivate, QLocalServer::SocketOptions, socketOptions)