KDECore
k3sockssocketdevice.h
Go to the documentation of this file.
00001 /* -*- C++ -*- 00002 * Copyright (C) 2004,2005 Thiago Macieira <thiago@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 as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KSOCKSSOCKETDEVICE_H 00021 #define KSOCKSSOCKETDEVICE_H 00022 00023 #include "k3socketdevice.h" 00024 00025 namespace KNetwork { 00026 00027 class KSocksSocketDevicePrivate; 00042 class KDECORE_EXPORT KSocksSocketDevice: public KSocketDevice 00043 { 00044 public: 00048 KSocksSocketDevice(const KSocketBase* = 0L); 00049 00053 explicit KSocksSocketDevice(int fd); 00054 00058 virtual ~KSocksSocketDevice(); 00059 00063 virtual int capabilities() const; 00064 00068 virtual bool bind(const KResolverEntry& address); 00069 00073 virtual bool listen(int backlog); 00074 00078 virtual bool connect(const KResolverEntry& address); 00079 00083 virtual KSocksSocketDevice* accept(); 00084 00088 virtual qint64 readBlock(char *data, quint64 maxlen); 00089 00096 virtual qint64 readBlock(char *data, quint64 maxlen, KSocketAddress& from); 00097 00101 virtual qint64 peekBlock(char *data, quint64 maxlen); 00102 00106 virtual qint64 peekBlock(char *data, quint64 maxlen, KSocketAddress& from); 00107 00111 virtual qint64 writeBlock(const char *data, quint64 len); 00112 00116 virtual qint64 writeBlock(const char *data, quint64 len, const KSocketAddress& to); 00117 00121 virtual KSocketAddress localAddress() const; 00122 00126 virtual KSocketAddress peerAddress() const; 00127 00131 virtual KSocketAddress externalAddress() const; 00132 00136 virtual bool poll(bool* input, bool* output, bool* exception = 0L, 00137 int timeout = -1, bool* timedout = 0L); 00138 00139 private: 00140 static void initSocks(); 00141 friend class KSocketDevice; 00142 KSocksSocketDevicePrivate * const d; 00143 }; 00144 00145 } // namespace KNetwork 00146 00147 #endif
KDE 4.6 API Reference