\section{KNetwork::KClient\-Socket\-Base Class Reference}
\label{classKNetwork_1_1KClientSocketBase}\index{KNetwork::KClientSocketBase@{KNetwork::KClientSocketBase}}
Abstract client socket class.  


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

Inheritance diagram for KNetwork::KClient\-Socket\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=183pt]{classKNetwork_1_1KClientSocketBase__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KNetwork::KClient\-Socket\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=150pt]{classKNetwork_1_1KClientSocketBase__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Socket\-State} \{ \par
{\bf Idle}, 
{\bf Host\-Lookup}, 
{\bf Host\-Found}, 
{\bf Bound}, 
\par
{\bf Connecting}, 
{\bf Open}, 
{\bf Closing}, 
{\bf Unconnected} =  Bound, 
\par
{\bf Connected} =  Open, 
{\bf Connection} =  Open
 \}
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf state\-Changed} (int newstate)
\item 
void {\bf got\-Error} (int code)
\item 
void {\bf host\-Found} ()
\item 
void {\bf bound} (const {\bf KResolver\-Entry} \&local)
\item 
void {\bf about\-To\-Connect} (const {\bf KResolver\-Entry} \&remote, bool \&skip)
\item 
void {\bf connected} (const {\bf KResolver\-Entry} \&remote)
\item 
void {\bf closed} ()
\item 
void {\bf ready\-Read} ()
\item 
void {\bf ready\-Write} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KClient\-Socket\-Base} ({\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
virtual {\bf $\sim$KClient\-Socket\-Base} ()
\item 
{\bf Socket\-State} {\bf state} () const 
\item 
{\bf KResolver} \& {\bf peer\-Resolver} () const 
\item 
const {\bf KResolver\-Results} \& {\bf peer\-Results} () const 
\item 
{\bf KResolver} \& {\bf local\-Resolver} () const 
\item 
const {\bf KResolver\-Results} \& {\bf local\-Results} () const 
\item 
void {\bf set\-Resolution\-Enabled} (bool enable)
\item 
void {\bf set\-Family} (int families)
\item 
virtual bool {\bf lookup} ()
\item 
virtual bool {\bf bind} (const {\bf QString} \&node=QString::null, const {\bf QString} \&service=QString::null)=0
\item 
virtual bool {\bf bind} (const {\bf KResolver\-Entry} \&address)
\item 
virtual bool {\bf connect} (const {\bf QString} \&node=QString::null, const {\bf QString} \&service=QString::null)=0
\item 
virtual bool {\bf connect} (const {\bf KResolver\-Entry} \&address)
\item 
void {\bf connect\-To\-Host} (const {\bf QString} \&host, Q\_\-UINT16 port)
\item 
virtual bool {\bf disconnect} ()
\item 
virtual bool {\bf open} (int)
\item 
virtual void {\bf close} ()
\item 
virtual void {\bf flush} ()
\item 
virtual Q\_\-LONG {\bf bytes\-Available} () const 
\item 
virtual Q\_\-LONG {\bf wait\-For\-More} (int msecs, bool $\ast$timeout=0L)
\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 
bool {\bf emits\-Ready\-Read} () const 
\item 
virtual void {\bf enable\-Read} (bool enable)
\item 
bool {\bf emits\-Ready\-Write} () const 
\item 
virtual void {\bf enable\-Write} (bool enable)
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Read\-Activity} ()
\item 
virtual void {\bf slot\-Write\-Activity} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf set\-Socket\-Options} (int opts)
\item 
void {\bf set\-State} ({\bf Socket\-State} state)
\item 
virtual void {\bf state\-Changing} ({\bf Socket\-State} new\-State)
\item 
void {\bf copy\-Error} ()
\end{CompactItemize}


\subsection{Detailed Description}
Abstract client socket class. 

This class provides the base functionality for client sockets, such as, and especially, name resolution and signals.

\begin{Desc}
\item[Note:]This class is abstract. If you're looking for a normal, client socket class, see {\bf KStream\-Socket}{\rm (p.\,\pageref{classKNetwork_1_1KStreamSocket})} and {\bf KBuffered\-Socket}{\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket})}\end{Desc}
\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 49 of file kclientsocketbase.h.

\subsection{Member Enumeration Documentation}
\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!SocketState@{SocketState}}
\index{SocketState@{SocketState}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KNetwork::KClient\-Socket\-Base::Socket\-State}}\label{classKNetwork_1_1KClientSocketBase_w10}


Socket states. 

These are the possible states for a {\bf KClient\-Socket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase})}:\begin{itemize}
\item Idle: socket is not connected\item Host\-Lookup: socket is doing host lookup prior to connecting\item Host\-Found: name lookup is complete\item Bound: the socket is locally bound\item Connecting: socket is attempting connection\item Open: socket is open\item Connected (=Open): socket is connected\item Connection (=Open): yet another name for a connected socket\item Closing: socket is shutting down\end{itemize}


Whenever the socket state changes, the {\bf state\-Changed(int)}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l0})} signal will be emitted. 

Definition at line 71 of file kclientsocketbase.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!KClientSocketBase@{KClientSocketBase}}
\index{KClientSocketBase@{KClientSocketBase}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KClient\-Socket\-Base::KClient\-Socket\-Base ({\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKNetwork_1_1KClientSocketBase_a0}


Default constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]the parent {\bf QObject} object \item[{\em name}]the name of this object \end{description}
\end{Desc}


Definition at line 50 of file kclientsocketbase.cpp.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!~KClientSocketBase@{$\sim$KClientSocketBase}}
\index{~KClientSocketBase@{$\sim$KClientSocketBase}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KClient\-Socket\-Base::$\sim${\bf KClient\-Socket\-Base} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a1}


Destructor. 



Definition at line 58 of file kclientsocketbase.cpp.

References close().

\subsection{Member Function Documentation}
\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!state@{state}}
\index{state@{state}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KClient\-Socket\-Base::Socket\-State} KClient\-Socket\-Base::state () const}\label{classKNetwork_1_1KClientSocketBase_a2}


Returns the current state for this socket. 

\begin{Desc}
\item[See also:]{\bf Socket\-State}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_w10})} \end{Desc}


Reimplemented from {\bf QIODevice}.

Definition at line 64 of file kclientsocketbase.cpp.

Referenced by KNetwork::KStream\-Socket::bind(), KNetwork::KDatagram\-Socket::bind(), bind(), close(), KNetwork::KStream\-Socket::connect(), KNetwork::KDatagram\-Socket::connect(), connect(), disconnect(), KNetwork::KBuffered\-Socket::enable\-Read(), lookup(), KNetwork::KStream\-Socket::remaining\-Timeout(), KNetwork::KStream\-Socket::set\-Timeout(), KNetwork::KBuffered\-Socket::slot\-Read\-Activity(), KNetwork::KBuffered\-Socket::slot\-Write\-Activity(), and KNetwork::KBuffered\-Socket::write\-Block().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!setSocketOptions@{setSocketOptions}}
\index{setSocketOptions@{setSocketOptions}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::set\-Socket\-Options (int {\em opts})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKNetwork_1_1KClientSocketBase_b0}


Sets the socket options. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

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

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_b0})}.

Definition at line 75 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::has\-Device(), KNetwork::KSocket\-Base::mutex(), KNetwork::KSocket\-Device::set\-Socket\-Options(), and KNetwork::KSocket\-Base::socket\-Device().

Referenced by KNetwork::KStream\-Socket::KStream\-Socket().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!peerResolver@{peerResolver}}
\index{peerResolver@{peerResolver}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KResolver} \& KClient\-Socket\-Base::peer\-Resolver () const}\label{classKNetwork_1_1KClientSocketBase_a3}


Returns the internal {\bf KResolver}{\rm (p.\,\pageref{classKNetwork_1_1KResolver})} object used for looking up the peer host name and service. 

This can be used to set extra options to the lookup process other than the default values, as well as obtaining the error codes in case of lookup failure. 

Definition at line 91 of file kclientsocketbase.cpp.

Referenced by KNetwork::KStream\-Socket::connect(), KNetwork::KDatagram\-Socket::connect(), KNetwork::KDatagram\-Socket::KDatagram\-Socket(), KNetwork::KStream\-Socket::KStream\-Socket(), and lookup().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!peerResults@{peerResults}}
\index{peerResults@{peerResults}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KResolver\-Results} \& KClient\-Socket\-Base::peer\-Results () const}\label{classKNetwork_1_1KClientSocketBase_a4}


Returns the internal list of resolved results for the peer address. 



Definition at line 96 of file kclientsocketbase.cpp.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!localResolver@{localResolver}}
\index{localResolver@{localResolver}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KResolver} \& KClient\-Socket\-Base::local\-Resolver () const}\label{classKNetwork_1_1KClientSocketBase_a5}


Returns the internal {\bf KResolver}{\rm (p.\,\pageref{classKNetwork_1_1KResolver})} object used for looking up the local host name and service. 

This can be used to set extra options to the lookup process other than the default values, as well as obtaining the error codes in case of lookup failure. 

Definition at line 101 of file kclientsocketbase.cpp.

Referenced by KNetwork::KStream\-Socket::bind(), KNetwork::KDatagram\-Socket::bind(), KNetwork::KDatagram\-Socket::KDatagram\-Socket(), KNetwork::KStream\-Socket::KStream\-Socket(), and lookup().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!localResults@{localResults}}
\index{localResults@{localResults}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KResolver\-Results} \& KClient\-Socket\-Base::local\-Results () const}\label{classKNetwork_1_1KClientSocketBase_a6}


Returns the internal list of resolved results for the local address. 



Definition at line 106 of file kclientsocketbase.cpp.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!setResolutionEnabled@{setResolutionEnabled}}
\index{setResolutionEnabled@{setResolutionEnabled}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::set\-Resolution\-Enabled (bool {\em enable})}\label{classKNetwork_1_1KClientSocketBase_a7}


Enables or disables name resolution. 

If this flag is set to true, {\bf bind}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a10})} and {\bf connect}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a12})} operations will trigger name lookup operations (i.e., converting a hostname into its binary form). If the flag is set to false, those operations will instead try to convert a string representation of an address without attempting name resolution.

This is useful, for instance, when IP addresses are in their string representation (such as \char`\"{}1.2.3.4\char`\"{}) or come from other sources like {\bf KSocket\-Address}{\rm (p.\,\pageref{classKSocketAddress})}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]whether to enable \end{description}
\end{Desc}


Definition at line 111 of file kclientsocketbase.cpp.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!setFamily@{setFamily}}
\index{setFamily@{setFamily}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::set\-Family (int {\em families})}\label{classKNetwork_1_1KClientSocketBase_a8}


Sets the allowed families for the resolutions. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em families}]the families that we want/accept \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KResolver::Socket\-Families}{\rm (p.\,\pageref{classKNetwork_1_1KResolver_w33})} for possible values \end{Desc}


Definition at line 125 of file kclientsocketbase.cpp.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!lookup@{lookup}}
\index{lookup@{lookup}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::lookup ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a9}


Starts the lookup for peer and local hostnames as well as their services. 

If the blocking mode for this object is on, this function will wait for the lookup results to be available (by calling the {\bf KResolver::wait}{\rm (p.\,\pageref{classKNetwork_1_1KResolver_a19})} method on the resolver objects).

When the lookup is done, the signal {\bf host\-Found}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l2})} will be emitted (only once, even if we're doing a double lookup). If the lookup failed (for any of the two lookups) the {\bf got\-Error}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l1})} signal will be emitted with the appropriate error condition (see {\bf KSocket\-Base::Socket\-Error}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase_w24})}).

This function returns true on success and false on error. Note that this is not the lookup result! 

Definition at line 131 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Base::blocking(), QObject::connect(), local\-Resolver(), peer\-Resolver(), set\-State(), QTimer::single\-Shot(), state(), state\-Changed(), and KNetwork::KResolver::wait().

Referenced by KNetwork::KDatagram\-Socket::bind(), KNetwork::KStream\-Socket::connect(), and KNetwork::KDatagram\-Socket::connect().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!bind@{bind}}
\index{bind@{bind}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KNetwork::KClient\-Socket\-Base::bind (const {\bf QString} \& {\em node} = {\tt QString::null}, const {\bf QString} \& {\em service} = {\tt QString::null})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KClientSocketBase_a10}


Binds this socket to the given nodename and service, or use the default ones if none are given. 

Upon successful binding, the {\bf bound}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l3})} signal will be emitted. If an error is found, the {\bf got\-Error}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l1})} signal will be emitted.

\begin{Desc}
\item[Note:]Due to the internals of the name lookup and binding mechanism, some (if not most) implementations of this function do not actually bind the socket until the connection is requested (see {\bf connect}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a12})}). They only set the values for future reference.\end{Desc}
This function returns true on success.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em node}]the nodename \item[{\em service}]the service \end{description}
\end{Desc}


Implemented in {\bf KNetwork::KDatagram\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KDatagramSocket_a2})}, and {\bf KNetwork::KStream\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KStreamSocket_a5})}.

Referenced by bind().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!bind@{bind}}
\index{bind@{bind}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::bind (const {\bf KResolver\-Entry} \& {\em address})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a11}


Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Connect this socket to this specific address.

Unlike {\bf bind(const QString\&, const QString\&)}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a10})} above, this function really does bind the socket. No lookup is performed. The {\bf bound}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l3})} signal will be emitted. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a2})}.

Reimplemented in {\bf KNetwork::KDatagram\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KDatagramSocket_a3})}, and {\bf KNetwork::KStream\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KStreamSocket_a6})}.

Definition at line 189 of file kclientsocketbase.cpp.

References bind(), bound(), KNetwork::KActive\-Socket\-Base::reset\-Error(), set\-State(), KNetwork::KSocket\-Base::socket\-Device(), state(), and state\-Changed().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!connect@{connect}}
\index{connect@{connect}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KNetwork::KClient\-Socket\-Base::connect (const {\bf QString} \& {\em node} = {\tt QString::null}, const {\bf QString} \& {\em service} = {\tt QString::null})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KClientSocketBase_a12}


Attempts to connect to the these hostname and service, or use the default ones if none are given. 

If a connection attempt is already in progress, check on its state and set the error status (No\-Error or In\-Progress).

If the blocking mode for this object is on, this function will only return when all the resolved peer addresses have been tried or when a connection is established.

Upon successfully connecting, the {\bf connected}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l5})} signal will be emitted. If an error is found, the {\bf got\-Error}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l1})} signal will be emitted.

\begin{Desc}
\item[Note for derived classes:]Derived classes must implement this function. The implementation will set the parameters for the lookup (using the peer {\bf KResolver}{\rm (p.\,\pageref{classKNetwork_1_1KResolver})} object) and call {\bf lookup}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a9})} to start it.\end{Desc}
\begin{Desc}
\item[]The implementation should use the {\bf host\-Found}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l2})} signal to be notified of the completion of the lookup process and then proceed to start the connection itself. Care should be taken regarding the value of {\bf blocking}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase_a3})} flag.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em node}]the nodename \item[{\em service}]the service \end{description}
\end{Desc}


Implemented in {\bf KNetwork::KDatagram\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KDatagramSocket_a4})}, and {\bf KNetwork::KStream\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KStreamSocket_a7})}.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!connect@{connect}}
\index{connect@{connect}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::connect (const {\bf KResolver\-Entry} \& {\em address})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a13}


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a3})}.

Reimplemented in {\bf KNetwork::KDatagram\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KDatagramSocket_a5})}, and {\bf KNetwork::KStream\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KStreamSocket_a8})}.

Definition at line 210 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Device::connect(), connected(), copy\-Error(), KNetwork::KSocket\-Base::error(), set\-State(), KNetwork::KSocket\-Base::socket\-Device(), state(), and state\-Changed().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!connectToHost@{connectToHost}}
\index{connectToHost@{connectToHost}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::connect\-To\-Host (const {\bf QString} \& {\em host}, Q\_\-UINT16 {\em port})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KClientSocketBase_a14}


\begin{Desc}
\item[{\bf Deprecated}]This is a convenience function provided to ease migrating from {\bf Qt} 3.x's {\bf QSocket} class. \end{Desc}


Definition at line 260 of file kclientsocketbase.h.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!disconnect@{disconnect}}
\index{disconnect@{disconnect}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::disconnect ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a15}


Disconnects the socket. 

Note that not all socket types can disconnect. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a4})}.

Definition at line 244 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Device::disconnect(), set\-State(), KNetwork::KSocket\-Base::socket\-Device(), state(), and state\-Changed().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!open@{open}}
\index{open@{open}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KNetwork::KClient\-Socket\-Base::open (int)\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKNetwork_1_1KClientSocketBase_a16}


Opens the socket. 

Reimplemented from {\bf QIODevice}.

You should not call this function; instead, use {\bf connect}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a12})} 

Reimplemented from {\bf QIODevice}.

Definition at line 274 of file kclientsocketbase.h.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!close@{close}}
\index{close@{close}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::close ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a17}


Closes the socket. 

Reimplemented from {\bf QIODevice}.

The closing of the socket causes the emission of the signal {\bf closed}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l6})}. 

Reimplemented from {\bf QIODevice}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a3})}.

Definition at line 261 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Device::close(), closed(), set\-State(), KNetwork::KSocket\-Base::socket\-Device(), state(), and state\-Changed().

Referenced by $\sim$KClient\-Socket\-Base().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!flush@{flush}}
\index{flush@{flush}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KNetwork::KClient\-Socket\-Base::flush ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKNetwork_1_1KClientSocketBase_a18}


This call is not supported on sockets. 

Reimplemented from {\bf QIODevice}. 

Reimplemented from {\bf QIODevice}.

Definition at line 288 of file kclientsocketbase.h.\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!bytesAvailable@{bytesAvailable}}
\index{bytesAvailable@{bytesAvailable}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::bytes\-Available () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a19}


Returns the number of bytes available on this socket. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a9})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a4})}.

Definition at line 281 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Device::bytes\-Available(), and KNetwork::KSocket\-Base::socket\-Device().

Referenced by KNetwork::KDatagram\-Socket::receive().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!waitForMore@{waitForMore}}
\index{waitForMore@{waitForMore}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::wait\-For\-More (int {\em msecs}, bool $\ast$ {\em timeout} = {\tt 0L})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a20}


Waits for more data. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a10})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a5})}.

Definition at line 289 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KActive\-Socket\-Base::reset\-Error(), KNetwork::KSocket\-Base::socket\-Device(), and KNetwork::KSocket\-Device::wait\-For\-More().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!readBlock@{readBlock}}
\index{readBlock@{readBlock}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::read\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a21}


Reads data from a socket. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a11})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a6})}.

Definition at line 301 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KSocket\-Device::read\-Block(), KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KSocket\-Base::socket\-Device().

Referenced by KNetwork::KDatagram\-Socket::receive().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!readBlock@{readBlock}}
\index{readBlock@{readBlock}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::read\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen}, {\bf KSocket\-Address} \& {\em from})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a22}


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reads data from a socket. Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a12})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a7})}.

Definition at line 313 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KSocket\-Device::read\-Block(), KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KSocket\-Base::socket\-Device().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!peekBlock@{peekBlock}}
\index{peekBlock@{peekBlock}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::peek\-Block (char $\ast$ {\em data}, Q\_\-ULONG {\em maxlen})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a23}


Peeks data from the socket. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a13})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a8})}.

Definition at line 325 of file kclientsocketbase.cpp.

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


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Peeks data from the socket. Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a14})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a9})}.

Definition at line 337 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KSocket\-Device::peek\-Block(), KNetwork::KActive\-Socket\-Base::reset\-Error(), and KNetwork::KSocket\-Base::socket\-Device().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!writeBlock@{writeBlock}}
\index{writeBlock@{writeBlock}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::write\-Block (const char $\ast$ {\em data}, Q\_\-ULONG {\em len})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a25}


Writes data to the socket. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a15})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a10})}.

Definition at line 349 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KActive\-Socket\-Base::reset\-Error(), KNetwork::KSocket\-Base::socket\-Device(), and KNetwork::KSocket\-Device::write\-Block().

Referenced by KNetwork::KDatagram\-Socket::send().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!writeBlock@{writeBlock}}
\index{writeBlock@{writeBlock}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-LONG KClient\-Socket\-Base::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_1KClientSocketBase_a26}


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Writes data to the socket. Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a16})}.

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a11})}.

Definition at line 361 of file kclientsocketbase.cpp.

References copy\-Error(), KNetwork::KSocket\-Base::error(), got\-Error(), KNetwork::KActive\-Socket\-Base::reset\-Error(), KNetwork::KSocket\-Base::socket\-Device(), and KNetwork::KSocket\-Device::write\-Block().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!localAddress@{localAddress}}
\index{localAddress@{localAddress}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocket\-Address} KClient\-Socket\-Base::local\-Address () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a27}


Returns the local socket address. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a20})}.

Definition at line 373 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Device::local\-Address(), and KNetwork::KSocket\-Base::socket\-Device().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!peerAddress@{peerAddress}}
\index{peerAddress@{peerAddress}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSocket\-Address} KClient\-Socket\-Base::peer\-Address () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a28}


Returns the peer socket address. 

Reimplemented from {\bf KSocket\-Base}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase})}. 

Implements {\bf KNetwork::KActive\-Socket\-Base} {\rm (p.\,\pageref{classKNetwork_1_1KActiveSocketBase_a21})}.

Definition at line 378 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Device::peer\-Address(), and KNetwork::KSocket\-Base::socket\-Device().

Referenced by KNetwork::KBuffered\-Socket::peek\-Block(), and KNetwork::KBuffered\-Socket::read\-Block().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!emitsReadyRead@{emitsReadyRead}}
\index{emitsReadyRead@{emitsReadyRead}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::emits\-Ready\-Read () const}\label{classKNetwork_1_1KClientSocketBase_a29}


Returns true if the ready\-Read signal is set to be emitted. 



Definition at line 383 of file kclientsocketbase.cpp.

Referenced by KNetwork::KBuffered\-Socket::slot\-Read\-Activity(), and KNetwork::KBuffered\-Socket::state\-Changing().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!enableRead@{enableRead}}
\index{enableRead@{enableRead}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::enable\-Read (bool {\em enable})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a30}


Enables the emission of the ready\-Read signal. 

By default, this signal is enabled.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]whether to enable the signal \end{description}
\end{Desc}


Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a12})}.

Definition at line 388 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Base::mutex(), KNetwork::KSocket\-Device::read\-Notifier(), QSocket\-Notifier::set\-Enabled(), and KNetwork::KSocket\-Base::socket\-Device().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!emitsReadyWrite@{emitsReadyWrite}}
\index{emitsReadyWrite@{emitsReadyWrite}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KClient\-Socket\-Base::emits\-Ready\-Write () const}\label{classKNetwork_1_1KClientSocketBase_a31}


Returns true if the ready\-Write signal is set to be emitted. 



Definition at line 398 of file kclientsocketbase.cpp.

Referenced by KNetwork::KBuffered\-Socket::state\-Changing().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!enableWrite@{enableWrite}}
\index{enableWrite@{enableWrite}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::enable\-Write (bool {\em enable})\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KClientSocketBase_a32}


Enables the emission of the ready\-Write signal. 

By default, this signal is disabled.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]whether to enable the signal \end{description}
\end{Desc}


Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_a13})}.

Definition at line 403 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Base::mutex(), QSocket\-Notifier::set\-Enabled(), KNetwork::KSocket\-Base::socket\-Device(), and KNetwork::KSocket\-Device::write\-Notifier().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!slotReadActivity@{slotReadActivity}}
\index{slotReadActivity@{slotReadActivity}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::slot\-Read\-Activity ()\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKNetwork_1_1KClientSocketBase_j0}


This slot is connected to the read notifier's signal meaning the socket can read more data. 

The default implementation only emits the ready\-Read signal.

Override if your class requires processing of incoming data. 

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_j0})}.

Definition at line 413 of file kclientsocketbase.cpp.

References ready\-Read().

Referenced by state\-Changing().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!slotWriteActivity@{slotWriteActivity}}
\index{slotWriteActivity@{slotWriteActivity}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::slot\-Write\-Activity ()\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKNetwork_1_1KClientSocketBase_j1}


This slot is connected to the write notifier's signal meaning the socket can write more data. 

The default implementation only emits the ready\-Write signal.

Override if your class writes data from another source (like a buffer). 

Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_j1})}.

Definition at line 419 of file kclientsocketbase.cpp.

References ready\-Write().

Referenced by state\-Changing().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!stateChanged@{stateChanged}}
\index{stateChanged@{stateChanged}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::state\-Changed (int {\em newstate})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l0}


This signal is emitted whenever the socket state changes. 

Note: do not delete this object inside the slot called by this signal.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newstate}]the new state of the socket object \end{description}
\end{Desc}


Referenced by bind(), close(), KNetwork::KBuffered\-Socket::close(), KNetwork::KDatagram\-Socket::connect(), connect(), disconnect(), and lookup().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!gotError@{gotError}}
\index{gotError@{gotError}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::got\-Error (int {\em code})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l1}


This signal is emitted when this object finds an error. 

The {\tt code} parameter contains the error code that can also be found by calling {\bf error}{\rm (p.\,\pageref{classKNetwork_1_1KSocketBase_a13})}. 

Referenced by KNetwork::KStream\-Socket::connect(), peek\-Block(), KNetwork::KBuffered\-Socket::peek\-Block(), read\-Block(), KNetwork::KBuffered\-Socket::read\-Block(), KNetwork::KDatagram\-Socket::receive(), KNetwork::KBuffered\-Socket::slot\-Read\-Activity(), KNetwork::KBuffered\-Socket::slot\-Write\-Activity(), wait\-For\-More(), write\-Block(), and KNetwork::KBuffered\-Socket::write\-Block().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!hostFound@{hostFound}}
\index{hostFound@{hostFound}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::host\-Found ()\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l2}


This signal is emitted when the lookup is successfully completed. 



Referenced by KNetwork::KStream\-Socket::connect(), and KNetwork::KDatagram\-Socket::KDatagram\-Socket().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!bound@{bound}}
\index{bound@{bound}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::bound (const {\bf KResolver\-Entry} \& {\em local})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l3}


This signal is emitted when the socket successfully binds to an address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em local}]the local address we bound to \end{description}
\end{Desc}


Referenced by bind().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!aboutToConnect@{aboutToConnect}}
\index{aboutToConnect@{aboutToConnect}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::about\-To\-Connect (const {\bf KResolver\-Entry} \& {\em remote}, bool \& {\em skip})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l4}


This signal is emitted when the socket is about to connect to an address (but before doing so). 

The {\tt skip} parameter can be used to make the loop skip this address. Its value is initially false: change it to true if you want to skip the current address (as given by {\tt remote}).

This function is also useful if one wants to reset the timeout.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em remote}]the address we're about to connect to \item[{\em skip}]set to true if you want to skip this address \end{description}
\end{Desc}
\begin{Desc}
\item[Note:]if the connection is successful, the {\bf connected}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l5})} signal will be emitted. \end{Desc}
\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!connected@{connected}}
\index{connected@{connected}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::connected (const {\bf KResolver\-Entry} \& {\em remote})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l5}


This socket is emitted when the socket successfully connects to a remote address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em remote}]the remote address we did connect to \end{description}
\end{Desc}


Referenced by connect().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!closed@{closed}}
\index{closed@{closed}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::closed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l6}


This signal is emitted when the socket completes the closing/shut down process. 



Referenced by close().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!readyRead@{readyRead}}
\index{readyRead@{readyRead}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::ready\-Read ()\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l7}


This signal is emitted whenever the socket is ready for reading -- i.e., there is data to be read in the buffers. 

The subsequent read operation is guaranteed to be non-blocking.

You can toggle the emission of this signal with the {\bf enable\-Read}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a30})} function. This signal is by default enabled. 

Referenced by slot\-Read\-Activity(), and KNetwork::KBuffered\-Socket::slot\-Read\-Activity().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!readyWrite@{readyWrite}}
\index{readyWrite@{readyWrite}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KClient\-Socket\-Base::ready\-Write ()\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KClientSocketBase_l8}


This signal is emitted whenever the socket is ready for writing -- i.e., whenever there's space available in the buffers to receive more data. 

The subsequent write operation is guaranteed to be non-blocking.

You can toggle the emission of this signal with the {\bf enable\-Write}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_a32})} function. This signal is by default disabled. You will want to disable this signal after the first reception, since it'll probably fire at every event loop. 

Referenced by slot\-Write\-Activity().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!setState@{setState}}
\index{setState@{setState}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::set\-State ({\bf Socket\-State} {\em state})\hspace{0.3cm}{\tt  [protected]}}\label{classKNetwork_1_1KClientSocketBase_b1}


Sets the socket state to {\tt state}. 

This function does not emit the {\bf state\-Changed}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_l0})} signal. 

Definition at line 69 of file kclientsocketbase.cpp.

References state\-Changing().

Referenced by KNetwork::KServer\-Socket::accept(), bind(), close(), KNetwork::KBuffered\-Socket::close(), KNetwork::KDatagram\-Socket::connect(), connect(), disconnect(), and lookup().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!stateChanging@{stateChanging}}
\index{stateChanging@{stateChanging}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::state\-Changing ({\bf Socket\-State} {\em new\-State})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKNetwork_1_1KClientSocketBase_b2}


This function is called by {\bf set\-State}{\rm (p.\,\pageref{classKNetwork_1_1KClientSocketBase_b1})} whenever the state changes. 

You should override it if you need to specify any actions to be done when the state changes.

The default implementation acts for these states only:\begin{itemize}
\item Connected: it sets up the socket notifiers to fire ready\-Read and ready\-Write signals. \end{itemize}


Reimplemented in {\bf KNetwork::KBuffered\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket_b1})}.

Definition at line 448 of file kclientsocketbase.cpp.

References QObject::connect(), KNetwork::KSocket\-Device::read\-Notifier(), QSocket\-Notifier::set\-Enabled(), slot\-Read\-Activity(), slot\-Write\-Activity(), KNetwork::KSocket\-Base::socket\-Device(), and KNetwork::KSocket\-Device::write\-Notifier().

Referenced by set\-State().\index{KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}!copyError@{copyError}}
\index{copyError@{copyError}!KNetwork::KClientSocketBase@{KNetwork::KClient\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KClient\-Socket\-Base::copy\-Error ()\hspace{0.3cm}{\tt  [protected]}}\label{classKNetwork_1_1KClientSocketBase_b3}


Convenience function to set this object's error code to match that of the socket device. 



Definition at line 472 of file kclientsocketbase.cpp.

References KNetwork::KSocket\-Base::error(), KNetwork::KActive\-Socket\-Base::set\-Error(), KNetwork::KSocket\-Base::socket\-Device(), and QIODevice::status().

Referenced by connect(), disconnect(), peek\-Block(), read\-Block(), set\-Socket\-Options(), KNetwork::KBuffered\-Socket::slot\-Read\-Activity(), KNetwork::KBuffered\-Socket::slot\-Write\-Activity(), wait\-For\-More(), and write\-Block().

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