\section{KNetwork::KSocks\-Socket\-Device Class Reference}
\label{classKNetwork_1_1KSocksSocketDevice}\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocksSocketDevice}}
The low-level class for SOCKS proxying.  


{\tt \#include $<$ksockssocketdevice.h$>$}

Inheritance diagram for KNetwork::KSocks\-Socket\-Device:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=183pt]{classKNetwork_1_1KSocksSocketDevice__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KNetwork::KSocks\-Socket\-Device:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=183pt]{classKNetwork_1_1KSocksSocketDevice__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KSocks\-Socket\-Device} (const {\bf KSocket\-Base} $\ast$=0L)
\item 
{\bf KSocks\-Socket\-Device} (int fd)
\item 
virtual {\bf $\sim$KSocks\-Socket\-Device} ()
\item 
virtual int {\bf capabilities} () const 
\item 
virtual bool {\bf bind} (const {\bf KResolver\-Entry} \&address)
\item 
virtual bool {\bf listen} (int backlog)
\item 
virtual bool {\bf connect} (const {\bf KResolver\-Entry} \&address)
\item 
virtual {\bf KSocks\-Socket\-Device} $\ast$ {\bf accept} ()
\item 
virtual Q\_\-LONG {\bf read\-Block} (char $\ast$data, Q\_\-ULONG maxlen)
\item 
virtual Q\_\-LONG {\bf read\-Block} (char $\ast$data, Q\_\-ULONG maxlen, {\bf KSocket\-Address} \&from)
\item 
virtual Q\_\-LONG {\bf peek\-Block} (char $\ast$data, Q\_\-ULONG maxlen)
\item 
virtual Q\_\-LONG {\bf peek\-Block} (char $\ast$data, Q\_\-ULONG maxlen, {\bf KSocket\-Address} \&from)
\item 
virtual Q\_\-LONG {\bf write\-Block} (const char $\ast$data, Q\_\-ULONG len)
\item 
virtual Q\_\-LONG {\bf write\-Block} (const char $\ast$data, Q\_\-ULONG len, const {\bf KSocket\-Address} \&to)
\item 
virtual {\bf KSocket\-Address} {\bf local\-Address} () const 
\item 
virtual {\bf KSocket\-Address} {\bf peer\-Address} () const 
\item 
virtual {\bf KSocket\-Address} {\bf external\-Address} () const 
\item 
virtual bool {\bf poll} (bool $\ast$input, bool $\ast$output, bool $\ast$exception=0L, int timeout=-1, bool $\ast$timedout=0L)
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KSocket\-Device}\label{classKNetwork_1_1KSocksSocketDevice_n0}

\end{CompactItemize}


\subsection{Detailed Description}
The low-level class for SOCKS proxying. 

This class reimplements several functions from {\bf KSocket\-Device}{\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice})} in order to implement SOCKS support.

This works by using KSocks.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$\end{Desc}
\begin{Desc}
\item[Warning:]This code is untested! \end{Desc}




Definition at line 40 of file ksockssocketdevice.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!KSocksSocketDevice@{KSocksSocketDevice}}
\index{KSocksSocketDevice@{KSocksSocketDevice}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSocks\-Socket\-Device::KSocks\-Socket\-Device (const {\bf KSocket\-Base} $\ast$ = {\tt 0L})}\label{classKNetwork_1_1KSocksSocketDevice_a0}


Constructor. 



Definition at line 41 of file ksockssocketdevice.cpp.

Referenced by accept().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!KSocksSocketDevice@{KSocksSocketDevice}}
\index{KSocksSocketDevice@{KSocksSocketDevice}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSocks\-Socket\-Device::KSocks\-Socket\-Device (int {\em fd})\hspace{0.3cm}{\tt  [explicit]}}\label{classKNetwork_1_1KSocksSocketDevice_a1}


Construct from a file descriptor. 



Definition at line 48 of file ksockssocketdevice.cpp.\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!~KSocksSocketDevice@{$\sim$KSocksSocketDevice}}
\index{~KSocksSocketDevice@{$\sim$KSocksSocketDevice}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSocks\-Socket\-Device::$\sim${\bf KSocks\-Socket\-Device} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a2}


Destructor. 



Definition at line 55 of file ksockssocketdevice.cpp.

\subsection{Member Function Documentation}
\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!capabilities@{capabilities}}
\index{capabilities@{capabilities}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSocks\-Socket\-Device::capabilities () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a3}


Sets our capabilities. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a4})}.

Definition at line 60 of file ksockssocketdevice.cpp.\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!bind@{bind}}
\index{bind@{bind}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSocks\-Socket\-Device::bind (const {\bf KResolver\-Entry} \& {\em address})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a4}


Overrides binding. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a11})}.

Definition at line 68 of file ksockssocketdevice.cpp.

References KNetwork::KSocket\-Device::create(), KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!listen@{listen}}
\index{listen@{listen}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSocks\-Socket\-Device::listen (int {\em backlog})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a5}


Overrides listening. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a12})}.

Definition at line 92 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!connect@{connect}}
\index{connect@{connect}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSocks\-Socket\-Device::connect (const {\bf KResolver\-Entry} \& {\em address})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a6}


Overrides connection. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a13})}.

Definition at line 114 of file ksockssocketdevice.cpp.

References KNetwork::KSocket\-Base::blocking(), KNetwork::KSocket\-Device::create(), KNetwork::KActive\-Socket\-Base::reset\-Error(), KNetwork::KSocket\-Base::set\-Blocking(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!accept@{accept}}
\index{accept@{accept}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocks\-Socket\-Device} $\ast$ KSocks\-Socket\-Device::accept ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a7}


Overrides accepting. 

The return type is specialised. 

Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a14})}.

Definition at line 164 of file ksockssocketdevice.cpp.

References KSocks\-Socket\-Device(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!readBlock@{readBlock}}
\index{readBlock@{readBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::read\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a8}


Overrides reading. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a18})}.

Definition at line 212 of file ksockssocketdevice.cpp.\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!readBlock@{readBlock}}
\index{readBlock@{readBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::read\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen}, {\bf KSocket\-Address} \& {\em from})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a9}


Reads data and the source address from this socket. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a19})}.

Definition at line 233 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!peekBlock@{peekBlock}}
\index{peekBlock@{peekBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::peek\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a10}


Overrides peeking. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a20})}.

Definition at line 254 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!peekBlock@{peekBlock}}
\index{peekBlock@{peekBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::peek\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen}, {\bf KSocket\-Address} \& {\em from})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a11}


Peeks the data in the socket and the source address. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a21})}.

Definition at line 275 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!writeBlock@{writeBlock}}
\index{writeBlock@{writeBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::write\-Block (const char $\ast$ {\em data}, Q\_\-ULONG {\em len})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a12}


Overrides writing. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a22})}.

Definition at line 296 of file ksockssocketdevice.cpp.\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!writeBlock@{writeBlock}}
\index{writeBlock@{writeBlock}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KSocks\-Socket\-Device::write\-Block (const char $\ast$ {\em data}, Q\_\-ULONG {\em len}, const {\bf KSocket\-Address} \& {\em to})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a13}


Writes the given data to the given destination address. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a23})}.

Definition at line 301 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!localAddress@{localAddress}}
\index{localAddress@{localAddress}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocket\-Address} KSocks\-Socket\-Device::local\-Address () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a14}


Overrides getting socket address. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a24})}.

Definition at line 323 of file ksockssocketdevice.cpp.

References KNetwork::KSocket\-Address::address(), KNetwork::KSocket\-Address::length(), local\-Address(), and KNetwork::KSocket\-Address::set\-Length().

Referenced by local\-Address().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!peerAddress@{peerAddress}}
\index{peerAddress@{peerAddress}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocket\-Address} KSocks\-Socket\-Device::peer\-Address () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a15}


Overrides getting peer address. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a25})}.

Definition at line 352 of file ksockssocketdevice.cpp.

References KNetwork::KSocket\-Address::address(), KNetwork::KSocket\-Address::length(), peer\-Address(), and KNetwork::KSocket\-Address::set\-Length().

Referenced by peer\-Address().\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!externalAddress@{externalAddress}}
\index{externalAddress@{externalAddress}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocket\-Address} KSocks\-Socket\-Device::external\-Address () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a16}


Overrides getting external address. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a26})}.

Definition at line 381 of file ksockssocketdevice.cpp.\index{KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}!poll@{poll}}
\index{poll@{poll}!KNetwork::KSocksSocketDevice@{KNetwork::KSocks\-Socket\-Device}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSocks\-Socket\-Device::poll (bool $\ast$ {\em input}, bool $\ast$ {\em output}, bool $\ast$ {\em exception} = {\tt 0L}, int {\em timeout} = {\tt -1}, bool $\ast$ {\em timedout} = {\tt 0L})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KSocksSocketDevice_a17}


Overrides polling. 



Reimplemented from {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a30})}.

Definition at line 387 of file ksockssocketdevice.cpp.

References KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KActive\-Socket\-Base::set\-Error().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
ksockssocketdevice.h\item 
ksockssocketdevice.cpp\end{CompactItemize}
