• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • network
klocalsocket_p.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE libraries
3 * Copyright (C) 2007 Thiago Macieira <thiago@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20#ifndef KLOCALSOCKET_P_H
21#define KLOCALSOCKET_P_H
22
23#include <QtCore/QString>
24#include <QtCore/QQueue>
25#include "klocalsocket.h"
26#define MIN_SOCKADDR_UN_LEN (sizeof(quint16) + sizeof(char))
27
28class QSocketNotifier;
29
30class KLocalSocketPrivate
31{
32public:
33 KLocalSocket * const q;
34 KLocalSocketPrivate(KLocalSocket *qq)
35 : q(qq), type(KLocalSocket::UnknownLocalSocketType)
36 { }
37
38 QString localPath;
39 QString peerPath;
40 KLocalSocket::LocalSocketType type;
41
42 void connectToPath(const QString &path, KLocalSocket::LocalSocketType type,
43 QAbstractSocket::OpenMode openMode);
44
45 void emitError(QAbstractSocket::SocketError, const QString &errorString);
46
47 static inline KLocalSocketPrivate *d(KLocalSocket *aq)
48 { return aq->d; }
49};
50
51class KLocalSocketServerPrivate
52{
53public:
54 KLocalSocketServer * const q;
55 KLocalSocketServerPrivate(KLocalSocketServer *qq);
56
57 int descriptor;
58 int maxPendingConnections;
59 QAbstractSocket::SocketState state;
60 QAbstractSocket::SocketError error;
61 KLocalSocket::LocalSocketType type;
62 QString localPath;
63 QString errorString;
64
65 QSocketNotifier *readNotifier;
66 QQueue<KLocalSocket *> pendingConnections;
67
68 bool listen(const QString &path, KLocalSocket::LocalSocketType type);
69 void close();
70 bool waitForNewConnection(int msec, bool *timedOut);
71 bool processSocketActivity();
72 void _k_newConnectionActivity();
73 void emitError(QAbstractSocket::SocketError, const QString &errorString);
74};
75
76#endif
KLocalSocketPrivate
Definition: klocalsocket_p.h:31
KLocalSocketPrivate::connectToPath
void connectToPath(const QString &path, KLocalSocket::LocalSocketType type, QAbstractSocket::OpenMode openMode)
Definition: klocalsocket_unix.cpp:171
KLocalSocketPrivate::type
KLocalSocket::LocalSocketType type
Definition: klocalsocket_p.h:40
KLocalSocketPrivate::KLocalSocketPrivate
KLocalSocketPrivate(KLocalSocket *qq)
Definition: klocalsocket_p.h:34
KLocalSocketPrivate::localPath
QString localPath
Definition: klocalsocket_p.h:38
KLocalSocketPrivate::emitError
void emitError(QAbstractSocket::SocketError, const QString &errorString)
Definition: klocalsocket.cpp:29
KLocalSocketPrivate::d
static KLocalSocketPrivate * d(KLocalSocket *aq)
Definition: klocalsocket_p.h:47
KLocalSocketPrivate::q
KLocalSocket *const q
Definition: klocalsocket_p.h:33
KLocalSocketPrivate::peerPath
QString peerPath
Definition: klocalsocket_p.h:39
KLocalSocketServerPrivate
Definition: klocalsocket_p.h:52
KLocalSocketServerPrivate::pendingConnections
QQueue< KLocalSocket * > pendingConnections
Definition: klocalsocket_p.h:66
KLocalSocketServerPrivate::maxPendingConnections
int maxPendingConnections
Definition: klocalsocket_p.h:58
KLocalSocketServerPrivate::errorString
QString errorString
Definition: klocalsocket_p.h:63
KLocalSocketServerPrivate::emitError
void emitError(QAbstractSocket::SocketError, const QString &errorString)
Definition: klocalsocket.cpp:38
KLocalSocketServerPrivate::close
void close()
Definition: klocalsocket_unix.cpp:318
KLocalSocketServerPrivate::type
KLocalSocket::LocalSocketType type
Definition: klocalsocket_p.h:61
KLocalSocketServerPrivate::localPath
QString localPath
Definition: klocalsocket_p.h:62
KLocalSocketServerPrivate::waitForNewConnection
bool waitForNewConnection(int msec, bool *timedOut)
Definition: klocalsocket_unix.cpp:337
KLocalSocketServerPrivate::error
QAbstractSocket::SocketError error
Definition: klocalsocket_p.h:60
KLocalSocketServerPrivate::state
QAbstractSocket::SocketState state
Definition: klocalsocket_p.h:59
KLocalSocketServerPrivate::descriptor
int descriptor
Definition: klocalsocket_p.h:57
KLocalSocketServerPrivate::_k_newConnectionActivity
void _k_newConnectionActivity()
Definition: klocalsocket_unix.cpp:399
KLocalSocketServerPrivate::readNotifier
QSocketNotifier * readNotifier
Definition: klocalsocket_p.h:65
KLocalSocketServerPrivate::listen
bool listen(const QString &path, KLocalSocket::LocalSocketType type)
Definition: klocalsocket_unix.cpp:238
KLocalSocketServerPrivate::processSocketActivity
bool processSocketActivity()
Definition: klocalsocket_unix.cpp:374
KLocalSocketServerPrivate::q
KLocalSocketServer *const q
Definition: klocalsocket_p.h:54
KLocalSocketServer
KLocalSocketServer allows one to create a listening local socket and accept incoming connections.
Definition: klocalsocket.h:160
KLocalSocket
KLocalSocket allows one to create and use local (Unix) sockets.
Definition: klocalsocket.h:52
KLocalSocket::LocalSocketType
LocalSocketType
Defines the local socket type.
Definition: klocalsocket.h:59
QString
klocalsocket.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal