KDECore
k3sockssocketdevice.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }
00146
00147 #endif