• Skip to content
  • Skip to link menu
KDE 4.1 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 
00051 class KDECORE_EXPORT KSocks {
00052 public:
00053 
00059    static KSocks *self();
00060 
00065    static bool activated();
00066 
00070    void disableSocks();
00071 
00075    void enableSocks();
00076 
00081    bool usingSocks();
00082 
00087    bool hasSocks();
00088 
00093    bool hasWorkingAsyncConnect();
00094 
00095    /*
00096     **     REIMPLEMENTATIONS OF LIBC SOCKET FUNCTIONS
00097     **/
00102     int     connect     (int sockfd, const sockaddr *serv_addr, 
00103                                 kde_socklen_t addrlen);
00108     signed long int read  (int fd, void *buf, unsigned long int count);
00113     signed long int write (int fd, const void *buf, unsigned long int count);
00118     int     recvfrom    (int s, void *buf, unsigned long int len, int flags, 
00119                                 sockaddr *from, kde_socklen_t *fromlen);
00124     int     sendto      (int s, const void *msg, unsigned long int len, int flags,
00125                              const sockaddr *to, kde_socklen_t tolen);
00130     int     recv        (int s, void *buf, unsigned long int len, int flags);
00135     int     send        (int s, const void *msg, unsigned long int len, int flags);
00140     int     getsockname (int s, sockaddr *name, kde_socklen_t *namelen);
00145     int     getpeername (int s, sockaddr *name, kde_socklen_t *namelen);
00150     int     accept      (int s, sockaddr *addr, kde_socklen_t *addrlen);
00155     int     select      (int n, fd_set *readfds, fd_set *writefds, 
00156                                 fd_set *exceptfds, struct timeval *timeout);
00161     int     listen      (int s, int backlog);
00162 
00167     int     bind        (int sockfd, sockaddr *my_addr, 
00168                                      kde_socklen_t addrlen);
00169     int     bind        (int sockfd, const sockaddr *my_addr, 
00170                                      kde_socklen_t addrlen);
00171 
00177    void die();
00178 
00183    static void disable();
00184 
00189    static void setConfig(const KConfigGroup *config);
00190 
00191 private:
00192    explicit KSocks(const KConfigGroup *config);
00193    ~KSocks();
00194 
00195    void stopSocks();
00196 
00197    static KSocks *_me;
00198    static bool _disabled;
00199 
00200 
00201    class KSocksPrivate;
00202    KSocksPrivate * const d;
00203 };
00204 
00205 #endif //Q_OS_UNIX
00206 
00207 #endif
00208 #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
  • 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