KDECore
k3streamsocket.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
00022
00023
00024
00025 #ifndef KSTREAMSOCKET_H
00026 #define KSTREAMSOCKET_H
00027
00028 #include <QtCore/QString>
00029
00030 #include "k3clientsocketbase.h"
00031
00033 namespace KNetwork {
00034
00035 class KResolverEntry;
00036 class KServerSocket;
00037 class KBufferedSocket;
00038
00039 class KStreamSocketPrivate;
00098 class KDECORE_EXPORT KStreamSocket: public KClientSocketBase
00099 {
00100 Q_OBJECT
00101
00102 public:
00110 explicit KStreamSocket(const QString& node = QString(), const QString& service = QString(),
00111 QObject* parent = 0L);
00112
00116 virtual ~KStreamSocket();
00117
00121 int timeout() const;
00122
00127 int remainingTimeout() const;
00128
00139 void setTimeout(int msecs);
00140
00164 virtual bool bind(const QString& node = QString(),
00165 const QString& service = QString());
00166
00175 virtual bool bind(const KResolverEntry& entry);
00176
00199 virtual bool connect(const QString& node = QString(),
00200 const QString& service = QString(),
00201 OpenMode mode = ReadWrite);
00202
00206 virtual bool connect(const KResolverEntry& entry,
00207 OpenMode mode = ReadWrite);
00208
00209 Q_SIGNALS:
00213 void timedOut();
00214
00215 private Q_SLOTS:
00216 void hostFoundSlot();
00217 void connectionEvent();
00218 void timeoutSlot();
00219
00220 private:
00228 bool bindLocallyFor(const KResolverEntry& peer);
00229
00238 void connectionSucceeded(const KResolverEntry& peer);
00239
00240 KStreamSocket(const KStreamSocket&);
00241 KStreamSocket& operator=(const KStreamSocket&);
00242
00243 KStreamSocketPrivate* const d;
00244
00245 friend class KServerSocket;
00246 friend class KBufferedSocket;
00247 };
00248
00249 }
00250
00251 #endif