54 #define SYSTEM_MAX_PENDING_SOCKETS 8 65 listener.
handle = CreateNamedPipe(
67 PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
71 PIPE_UNLIMITED_INSTANCES,
77 if (listener.
handle == INVALID_HANDLE_VALUE) {
86 switch (GetLastError()) {
87 case ERROR_IO_PENDING:
90 case ERROR_PIPE_CONNECTED:
95 CloseHandle(listener.
handle);
101 Q_ASSERT_X(
false,
"QLocalServerPrivate::addListener",
"The impossible happened");
109 int windowsError = GetLastError();
158 for (
int i = 0; i <
listeners.size(); ) {
161 || GetOverlappedResult(handle, &
listeners[i].overlapped, &dummy,
FALSE))
171 q->incomingConnection((
quintptr)handle);
173 if (GetLastError() != ERROR_IO_INCOMPLETE) {
190 for (
int i = 0; i <
listeners.size(); ++i)
201 DWORD result = WaitForSingleObject(
eventHandle, (msecs == -1) ? INFINITE : msecs);
202 if (result == WAIT_TIMEOUT) {
QString qt_error_string(int errorCode)
int maxPendingConnections
bool listen(const QString &name)
QIntegerForSizeof< void * >::Unsigned quintptr
void waitForNewConnection(int msec, bool *timedOut)
#define QT_END_NAMESPACE
This macro expands to.
QList< Listener > listeners
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void _q_onNewConnection()
We have received a notification that we can read on the listen socket.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QIntfbScreen * connected
QQueue< QLocalSocket * > pendingConnections
QWinEventNotifier * connectionEventNotifier
The QLocalServer class provides a local socket based server.
#define FALSE
Synonym for false.
void setError(const QString &function)
#define TRUE
Synonym for true.
#define Q_ASSERT_X(cond, where, what)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
#define SYSTEM_MAX_PENDING_SOCKETS
int size() const
Returns the number of items in the list.
QAbstractSocket::SocketError error
static QNSListener * listener
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void setEnabled(bool enable)
void deleteLater()
Schedules this object for deletion.
static bool removeServer(const QString &name)
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.