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

KDECore

  • kdecore
  • network
ksocketfactory.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
21#ifndef KSOCKETFACTORY_H
22#define KSOCKETFACTORY_H
23
24#include <kdecore_export.h>
25#include <QtCore/QString>
26#include <QtNetwork/QNetworkProxy>
27#include <QtNetwork/QHostAddress>
28
29class QTcpSocket;
30class QTcpServer;
31class QUdpSocket;
32class QUrl;
33
68namespace KSocketFactory
69{
99 KDECORE_EXPORT QTcpSocket *connectToHost(const QString &protocol, const QString &host,
100 quint16 port, QObject *parent = 0);
101
105 KDECORE_EXPORT QTcpSocket *connectToHost(const QUrl &url, QObject *parent = 0);
106
110 KDECORE_EXPORT void connectToHost(QTcpSocket *socket, const QString &protocol,
111 const QString &host, quint16 port);
112
116 KDECORE_EXPORT void connectToHost(QTcpSocket *socket, const QUrl &url);
117
145 KDECORE_EXPORT QTcpSocket *synchronousConnectToHost(const QString &protocol,
146 const QString &host,
147 quint16 port, int msecs = 30000,
148 QObject *parent = 0);
149
153 KDECORE_EXPORT QTcpSocket *synchronousConnectToHost(const QUrl &url, int msecs = 30000,
154 QObject *parent = 0);
155
159 KDECORE_EXPORT void synchronousConnectToHost(QTcpSocket *socket, const QString &protocol,
160 const QString &host, quint16 port,
161 int msecs = 30000);
162
166 KDECORE_EXPORT void synchronousConnectToHost(QTcpSocket *socket, const QUrl &url,
167 int msecs = 30000);
168
189 KDECORE_EXPORT QTcpServer *listen(const QString &protocol, const QHostAddress &address = QHostAddress::Any,
190 quint16 port = 0, QObject *parent = 0);
191
192 // These functions below aren't done yet
193 // Undocumented -> don't use!
194
195 KDECORE_EXPORT QUdpSocket *datagramSocket(const QString &protocol, const QString &host, QObject *parent = 0);
196
197#ifndef QT_NO_NETWORKPROXY
198 KDECORE_EXPORT QNetworkProxy proxyForConnection(const QString &protocol, const QString &host);
199 KDECORE_EXPORT QNetworkProxy proxyForListening(const QString &protocol);
200 KDECORE_EXPORT QNetworkProxy proxyForDatagram(const QString &protocol, const QString &host);
201#endif
202}
203
204#endif
QObject
QString
QTcpSocket
QUrl
kdecore_export.h
KSocketFactory
KSocketFactory provides functions for opening sockets to remote hosts.
KSocketFactory::proxyForConnection
QNetworkProxy proxyForConnection(const QString &protocol, const QString &host)
Definition: ksocketfactory.cpp:137
KSocketFactory::datagramSocket
QUdpSocket * datagramSocket(const QString &protocol, const QString &host, QObject *parent=0)
Definition: ksocketfactory.cpp:126
KSocketFactory::connectToHost
QTcpSocket * connectToHost(const QString &protocol, const QString &host, quint16 port, QObject *parent=0)
Initiates a TCP/IP socket connection to remote node (host) host, using the protocol.
Definition: ksocketfactory.cpp:69
KSocketFactory::proxyForDatagram
QNetworkProxy proxyForDatagram(const QString &protocol, const QString &host)
Definition: ksocketfactory.cpp:147
KSocketFactory::proxyForListening
QNetworkProxy proxyForListening(const QString &protocol)
Definition: ksocketfactory.cpp:142
KSocketFactory::synchronousConnectToHost
QTcpSocket * synchronousConnectToHost(const QString &protocol, const QString &host, quint16 port, int msecs=30000, QObject *parent=0)
This function behaves exactly like connectToHost() above, except that the socket it returns is either...
Definition: ksocketfactory.cpp:100
KSocketFactory::listen
QTcpServer * listen(const QString &protocol, const QHostAddress &address=QHostAddress::Any, quint16 port=0, QObject *parent=0)
Opens a TCP/IP socket for listening protocol protocol, binding only at address address.
Definition: ksocketfactory.cpp:115
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