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

KDECore

k3socks.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2001 George Staikos <staikos@kde.org>
00003  
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007  
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012  
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 #ifndef _KSOCKS_H_
00019 #define _KSOCKS_H_
00020 
00021 #if defined(I_KNOW_KSOCKS_ISNT_PUBLIC)
00022 /* "ksocks.h is not public API" */
00023 
00024 #include <kdecore_export.h>
00025 
00026 #include <QtCore/QStringList>
00027 #include <sys/types.h>
00028 #include <sys/socket.h>
00029 #include <sys/time.h>
00030 #include <unistd.h>
00031 
00032 #ifdef Q_OS_UNIX
00033 
00034 class KConfigGroup;
00035 struct sockaddr;
00036 
00037 #ifdef __CYGWIN__
00038 typedef unsigned ksocklen_t;
00039 #endif
00040 
00052 class KDECORE_EXPORT KSocks {
00053 public:
00054 
00060    static KSocks *self();
00061 
00066    static bool activated();
00067 
00071    void disableSocks();
00072 
00076    void enableSocks();
00077 
00082    bool usingSocks();
00083 
00088    bool hasSocks();
00089 
00094    bool hasWorkingAsyncConnect();
00095 
00096    /*
00097     **     REIMPLEMENTATIONS OF LIBC SOCKET FUNCTIONS
00098     **/
00103     int     connect     (int sockfd, const sockaddr *serv_addr, 
00104                                 kde_socklen_t addrlen);
00109     signed long int read  (int fd, void *buf, unsigned long int count);
00114     signed long int write (int fd, const void *buf, unsigned long int count);
00119     int     recvfrom    (int s, void *buf, unsigned long int len, int flags, 
00120                                 sockaddr *from, kde_socklen_t *fromlen);
00125     int     sendto      (int s, const void *msg, unsigned long int len, int flags,
00126                              const sockaddr *to, kde_socklen_t tolen);
00131     int     recv        (int s, void *buf, unsigned long int len, int flags);
00136     int     send        (int s, const void *msg, unsigned long int len, int flags);
00141     int     getsockname (int s, sockaddr *name, kde_socklen_t *namelen);
00146     int     getpeername (int s, sockaddr *name, kde_socklen_t *namelen);
00151     int     accept      (int s, sockaddr *addr, kde_socklen_t *addrlen);
00156     int     select      (int n, fd_set *readfds, fd_set *writefds, 
00157                                 fd_set *exceptfds, struct timeval *timeout);
00162     int     listen      (int s, int backlog);
00163 
00168     int     bind        (int sockfd, sockaddr *my_addr, 
00169                                      kde_socklen_t addrlen);
00170     int     bind        (int sockfd, const sockaddr *my_addr, 
00171                                      kde_socklen_t addrlen);
00172 
00178    void die();
00179 
00184    static void disable();
00185 
00190    static void setConfig(const KConfigGroup *config);
00191 
00192 private:
00193    explicit KSocks(const KConfigGroup *config);
00194    ~KSocks();
00195 
00196    void stopSocks();
00197 
00198    static KSocks *_me;
00199    static bool _disabled;
00200 
00201 
00202    class KSocksPrivate;
00203    KSocksPrivate * const d;
00204 };
00205 
00206 #endif //Q_OS_UNIX
00207 
00208 #endif
00209 #endif //_KSOCKS_H_

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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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