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

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • kdecore
  • network
k3socks.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 George Staikos <staikos@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef _KSOCKS_H_
19 #define _KSOCKS_H_
20 
21 #if defined(I_KNOW_KSOCKS_ISNT_PUBLIC)
22 /* "ksocks.h is not public API" */
23 
24 #include <kdecore_export.h>
25 
26 #include <QtCore/QStringList>
27 #include <sys/types.h>
28 #include <sys/socket.h>
29 #include <sys/time.h>
30 #include <unistd.h>
31 
32 #ifdef Q_OS_UNIX
33 
34 class KConfigGroup;
35 struct sockaddr;
36 
37 
49 class KDECORE_EXPORT_DEPRECATED KSocks {
50 public:
51 
57  static KSocks *self();
58 
63  static bool activated();
64 
68  void disableSocks();
69 
73  void enableSocks();
74 
79  bool usingSocks();
80 
85  bool hasSocks();
86 
91  bool hasWorkingAsyncConnect();
92 
93  /*
94  ** REIMPLEMENTATIONS OF LIBC SOCKET FUNCTIONS
95  **/
100  int connect (int sockfd, const sockaddr *serv_addr,
101  kde_socklen_t addrlen);
106  signed long int read (int fd, void *buf, unsigned long int count);
111  signed long int write (int fd, const void *buf, unsigned long int count);
116  int recvfrom (int s, void *buf, unsigned long int len, int flags,
117  sockaddr *from, kde_socklen_t *fromlen);
122  int sendto (int s, const void *msg, unsigned long int len, int flags,
123  const sockaddr *to, kde_socklen_t tolen);
128  int recv (int s, void *buf, unsigned long int len, int flags);
133  int send (int s, const void *msg, unsigned long int len, int flags);
138  int getsockname (int s, sockaddr *name, kde_socklen_t *namelen);
143  int getpeername (int s, sockaddr *name, kde_socklen_t *namelen);
148  int accept (int s, sockaddr *addr, kde_socklen_t *addrlen);
153  int select (int n, fd_set *readfds, fd_set *writefds,
154  fd_set *exceptfds, struct timeval *timeout);
159  int listen (int s, int backlog);
160 
165  int bind (int sockfd, sockaddr *my_addr,
166  kde_socklen_t addrlen);
167  int bind (int sockfd, const sockaddr *my_addr,
168  kde_socklen_t addrlen);
169 
175  void die();
176 
181  static void disable();
182 
187  static void setConfig(const KConfigGroup *config);
188 
189 private:
190  explicit KSocks(const KConfigGroup *config);
191  ~KSocks();
192 
193  void stopSocks();
194 
195  static KSocks *_me;
196  static bool _disabled;
197 
198 
199  class KSocksPrivate;
200  KSocksPrivate * const d;
201 };
202 
203 #endif //Q_OS_UNIX
204 
205 #endif
206 #endif //_KSOCKS_H_
kdecore_export.h
timeout
int timeout
Definition: kkernel_mac.cpp:46
KSocketFactory::listen
QTcpServer * listen(const QString &protocol, const QHostAddress &address=QHostAddress::Any, quint16 port=0, QObject *parent=0)
Opens a TCP/IP socket for listening protocol protocol, binding only at address address.
Definition: ksocketfactory.cpp:115
KGlobal::config
KSharedConfigPtr config()
Returns the general config object.
Definition: kglobal.cpp:138
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal