KDECore
kstreamsocket.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 <qstring.h>
00029
00030 #include "kclientsocketbase.h"
00031
00033 namespace KNetwork {
00034
00035 class KResolverEntry;
00036 class KResolverResults;
00037 class KServerSocket;
00038 class KBufferedSocket;
00039
00040 class KStreamSocketPrivate;
00097 class KDECORE_EXPORT KStreamSocket: public KClientSocketBase
00098 {
00099 Q_OBJECT
00100
00101 public:
00110 KStreamSocket(const QString& node = QString::null, const QString& service = QString::null,
00111 QObject* parent = 0L, const char *name = 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::null,
00165 const QString& service = QString::null);
00166
00175 virtual bool bind(const KResolverEntry& entry)
00176 { return KClientSocketBase::bind(entry); }
00177
00199 virtual bool connect(const QString& node = QString::null,
00200 const QString& service = QString::null);
00201
00205 virtual bool connect(const KResolverEntry& entry);
00206
00207 signals:
00211 void timedOut();
00212
00213 private slots:
00214 void hostFoundSlot();
00215 void connectionEvent();
00216 void timeoutSlot();
00217
00218 private:
00226 bool bindLocallyFor(const KResolverEntry& peer);
00227
00236 void connectionSucceeded(const KResolverEntry& peer);
00237
00238 KStreamSocket(const KStreamSocket&);
00239 KStreamSocket& operator=(const KStreamSocket&);
00240
00241 KStreamSocketPrivate *d;
00242
00243 friend class KServerSocket;
00244 friend class KBufferedSocket;
00245 };
00246
00247 }
00248
00249 #endif