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;
00041 class KDECORE_EXPORT KSocksSocketDevice: public KSocketDevice
00042 {
00043 public:
00047 KSocksSocketDevice(const KSocketBase* = 0L);
00048
00052 explicit KSocksSocketDevice(int fd);
00053
00057 virtual ~KSocksSocketDevice();
00058
00062 virtual int capabilities() const;
00063
00067 virtual bool bind(const KResolverEntry& address);
00068
00072 virtual bool listen(int backlog);
00073
00077 virtual bool connect(const KResolverEntry& address);
00078
00082 virtual KSocksSocketDevice* accept();
00083
00087 virtual qint64 readBlock(char *data, quint64 maxlen);
00088
00095 virtual qint64 readBlock(char *data, quint64 maxlen, KSocketAddress& from);
00096
00100 virtual qint64 peekBlock(char *data, quint64 maxlen);
00101
00105 virtual qint64 peekBlock(char *data, quint64 maxlen, KSocketAddress& from);
00106
00110 virtual qint64 writeBlock(const char *data, quint64 len);
00111
00115 virtual qint64 writeBlock(const char *data, quint64 len, const KSocketAddress& to);
00116
00120 virtual KSocketAddress localAddress() const;
00121
00125 virtual KSocketAddress peerAddress() const;
00126
00130 virtual KSocketAddress externalAddress() const;
00131
00135 virtual bool poll(bool* input, bool* output, bool* exception = 0L,
00136 int timeout = -1, bool* timedout = 0L);
00137
00138 private:
00139 static void initSocks();
00140 friend class KSocketDevice;
00141 KSocksSocketDevicePrivate * const d;
00142 };
00143
00144 }
00145
00146 #endif