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

KDECore

k3serversocket.h

Go to the documentation of this file.
00001 /*  -*- C++ -*-
00002  *  Copyright (C) 2003,2005 Thiago Macieira <thiago@kde.org>
00003  *
00004  *
00005  *  Permission is hereby granted, free of charge, to any person obtaining
00006  *  a copy of this software and associated documentation files (the
00007  *  "Software"), to deal in the Software without restriction, including
00008  *  without limitation the rights to use, copy, modify, merge, publish,
00009  *  distribute, sublicense, and/or sell copies of the Software, and to
00010  *  permit persons to whom the Software is furnished to do so, subject to
00011  *  the following conditions:
00012  *
00013  *  The above copyright notice and this permission notice shall be included 
00014  *  in all copies or substantial portions of the Software.
00015  *
00016  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00017  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00019  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00020  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00021  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00022  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 #ifndef KSERVERSOCKET_H
00026 #define KSERVERSOCKET_H
00027 
00028 #include <QtCore/QObject>
00029 #include "k3socketbase.h"
00030 #include "k3streamsocket.h"
00031 
00032 namespace KNetwork {
00033 
00034 class KStreamSocket;
00035 class KResolver;
00036 class KResolverResults;
00037 
00038 class KServerSocketPrivate;
00107 class KDECORE_EXPORT KServerSocket: public QObject, public KPassiveSocketBase
00108 {
00109   Q_OBJECT
00110 public:
00120   KServerSocket(QObject* parent = 0L);
00121 
00138   explicit KServerSocket(const QString& service, QObject* parent = 0L);
00139 
00157   KServerSocket(const QString& node, const QString& service,
00158         QObject* parent = 0L);
00159 
00166   ~KServerSocket();
00167 
00168 protected:
00172   virtual bool setSocketOptions(int opts);
00173 
00174 public:
00183   KResolver& resolver() const;
00184 
00188   const KResolverResults& resolverResults() const;
00189 
00204   void setResolutionEnabled(bool enable);
00205 
00212   void setFamily(int families);
00213 
00227   void setAddress(const QString& service);
00228 
00244   void setAddress(const QString& node, const QString& service);
00245 
00253   void setTimeout(int msecs);
00254 
00272   virtual bool lookup();
00273 
00287   virtual bool bind(const QString& node, const QString& service);
00288 
00295   virtual bool bind(const QString& service);
00296 
00302   virtual bool bind();
00303 
00311   virtual bool bind(const KResolverEntry& address);
00312 
00326   virtual bool listen(int backlog = 5); // 5 is arbitrary
00327 
00331   virtual void close();
00332 
00344   void setAcceptBuffered(bool enable);
00345 
00358   virtual KStreamSocket* accept();
00359 
00363   virtual KSocketAddress localAddress() const;
00364 
00368   virtual KSocketAddress externalAddress() const;
00369 
00370 private Q_SLOTS:
00371   void lookupFinishedSlot();
00372 
00373 Q_SIGNALS:
00379   void gotError(int code);
00380 
00384   void hostFound();
00385 
00392   void bound(const KNetwork::KResolverEntry& local);
00393 
00398   void closed();
00399 
00405   void readyAccept();
00406 
00407 protected:
00412   void copyError();
00413 
00414 private:
00415   bool doBind();
00416   bool doListen();
00417 
00418 private:
00419   KServerSocket(const KServerSocket&);
00420   KServerSocket& operator=(const KServerSocket&);
00421 
00422   KServerSocketPrivate* const d;
00423 };
00424 
00425 }               // namespace KNetwork
00426 
00427 #endif

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal