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

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • 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 
29 class QTcpSocket;
30 class QTcpServer;
31 class QUdpSocket;
32 class QUrl;
33 
68 namespace 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
QHostAddress
kdecore_export.h
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::proxyForConnection
QNetworkProxy proxyForConnection(const QString &protocol, const QString &host)
Definition: ksocketfactory.cpp:137
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
KSocketFactory::proxyForListening
QNetworkProxy proxyForListening(const QString &protocol)
Definition: ksocketfactory.cpp:142
QUdpSocket
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
QObject
QString
KSocketFactory::datagramSocket
QUdpSocket * datagramSocket(const QString &protocol, const QString &host, QObject *parent=0)
Definition: ksocketfactory.cpp:126
QTcpServer
QUrl
KSocketFactory::proxyForDatagram
QNetworkProxy proxyForDatagram(const QString &protocol, const QString &host)
Definition: ksocketfactory.cpp:147
QTcpSocket
QNetworkProxy
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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