KDECore
ksocketfactory.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSOCKETFACTORY_H
00022 #define KSOCKETFACTORY_H
00023
00024 #include <kdecore_export.h>
00025 #include <QtCore/QString>
00026 #include <QtNetwork/QNetworkProxy>
00027 #include <QtNetwork/QHostAddress>
00028
00029 class QTcpSocket;
00030 class QTcpServer;
00031 class QUdpSocket;
00032 class QUrl;
00033
00068 namespace KSocketFactory
00069 {
00099 KDECORE_EXPORT QTcpSocket *connectToHost(const QString &protocol, const QString &host,
00100 quint16 port, QObject *parent = 0);
00101
00105 KDECORE_EXPORT QTcpSocket *connectToHost(const QUrl &url, QObject *parent = 0);
00106
00110 KDECORE_EXPORT void connectToHost(QTcpSocket *socket, const QString &protocol,
00111 const QString &host, quint16 port);
00112
00116 KDECORE_EXPORT void connectToHost(QTcpSocket *socket, const QUrl &url);
00117
00145 KDECORE_EXPORT QTcpSocket *synchronousConnectToHost(const QString &protocol,
00146 const QString &host,
00147 quint16 port, int msecs = 30000,
00148 QObject *parent = 0);
00149
00153 KDECORE_EXPORT QTcpSocket *synchronousConnectToHost(const QUrl &url, int msecs = 30000,
00154 QObject *parent = 0);
00155
00159 KDECORE_EXPORT void synchronousConnectToHost(QTcpSocket *socket, const QString &protocol,
00160 const QString &host, quint16 port,
00161 int msecs = 30000);
00162
00166 KDECORE_EXPORT void synchronousConnectToHost(QTcpSocket *socket, const QUrl &url,
00167 int msecs = 30000);
00168
00189 KDECORE_EXPORT QTcpServer *listen(const QString &protocol, const QHostAddress &address = QHostAddress::Any,
00190 quint16 port = 0, QObject *parent = 0);
00191
00192
00193
00194
00195 KDECORE_EXPORT QUdpSocket *datagramSocket(const QString &protocol, const QString &host, QObject *parent = 0);
00196
00197 KDECORE_EXPORT QNetworkProxy proxyForConnection(const QString &protocol, const QString &host);
00198 KDECORE_EXPORT QNetworkProxy proxyForListening(const QString &protocol);
00199 KDECORE_EXPORT QNetworkProxy proxyForDatagram(const QString &protocol, const QString &host);
00200 }
00201
00202 #endif