kserversocket.h
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 KSERVERSOCKET_H
00026 #define KSERVERSOCKET_H
00027
00028 #include <qobject.h>
00029 #include "ksocketbase.h"
00030
00031 namespace KNetwork {
00032
00033 class KSocketDevice;
00034 class KStreamSocket;
00035 class KResolver;
00036 class KResolverResults;
00037
00038 class KServerSocketPrivate;
00063 class KServerSocket: public QObject, public KPassiveSocketBase
00064 {
00065 Q_OBJECT
00066 public:
00077 KServerSocket(QObject* parent = 0L, const char *name = 0L);
00078
00090 KServerSocket(const QString& service, QObject* parent = 0L, const char *name = 0L);
00091
00104 KServerSocket(const QString& node, const QString& service,
00105 QObject* parent = 0L, const char *name = 0L);
00106
00113 ~KServerSocket();
00114
00115 protected:
00119 virtual bool setSocketOptions(int opts);
00120
00121 public:
00130 KResolver& resolver() const;
00131
00135 const KResolverResults& resolverResults() const;
00136
00151 void setResolutionEnabled(bool enable);
00152
00159 void setFamily(int families);
00160
00168 void setAddress(const QString& service);
00169
00178 void setAddress(const QString& node, const QString& service);
00179
00187 void setTimeout(int msecs);
00188
00206 virtual bool lookup();
00207
00221 virtual bool bind(const QString& node, const QString& service);
00222
00229 virtual bool bind(const QString& service);
00230
00236 virtual bool bind();
00237
00245 virtual bool bind(const KResolverEntry& address);
00246
00260 virtual bool listen(int backlog = 5);
00261
00265 virtual void close();
00266
00278 void setAcceptBuffered(bool enable);
00279
00297 virtual KActiveSocketBase* accept();
00298
00302 virtual KSocketAddress localAddress() const;
00303
00307 virtual KSocketAddress externalAddress() const;
00308
00309 private slots:
00310 void lookupFinishedSlot();
00311
00312 signals:
00318 void gotError(int code);
00319
00323 void hostFound();
00324
00331 void bound(const KResolverEntry& local);
00332
00337 void closed();
00338
00344 void readyAccept();
00345
00346 protected:
00351 void copyError();
00352
00353 private:
00354 bool doBind();
00355
00356 private:
00357 KServerSocket(const KServerSocket&);
00358 KServerSocket& operator=(const KServerSocket&);
00359
00360 KServerSocketPrivate *d;
00361 };
00362
00363 }
00364
00365 #endif
This file is part of the documentation for kdecore Library Version 3.3.2.