\section{KNetwork::KPassive\-Socket\-Base Class Reference}
\label{classKNetwork_1_1KPassiveSocketBase}\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassiveSocketBase}}
Abstract base class for passive sockets.  


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

Inheritance diagram for KNetwork::KPassive\-Socket\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=284pt]{classKNetwork_1_1KPassiveSocketBase__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KNetwork::KPassive\-Socket\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=98pt]{classKNetwork_1_1KPassiveSocketBase__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPassive\-Socket\-Base} ()
\item 
virtual {\bf $\sim$KPassive\-Socket\-Base} ()
\item 
virtual bool {\bf bind} (const {\bf KResolver\-Entry} \&address)=0
\item 
virtual bool {\bf listen} (int backlog)=0
\item 
virtual void {\bf close} ()=0
\item 
virtual {\bf KActive\-Socket\-Base} $\ast$ {\bf accept} ()=0
\item 
virtual {\bf KSocket\-Address} {\bf local\-Address} () const =0
\item 
virtual {\bf KSocket\-Address} {\bf external\-Address} () const =0
\end{CompactItemize}


\subsection{Detailed Description}
Abstract base class for passive sockets. 

This socket provides the initial functionality for passive sockets, i.e., sockets that accept incoming connections.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 683 of file ksocketbase.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!KPassiveSocketBase@{KPassiveSocketBase}}
\index{KPassiveSocketBase@{KPassiveSocketBase}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPassive\-Socket\-Base::KPassive\-Socket\-Base ()}\label{classKNetwork_1_1KPassiveSocketBase_a0}


Constructor. 



Definition at line 321 of file ksocketbase.cpp.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!~KPassiveSocketBase@{$\sim$KPassiveSocketBase}}
\index{~KPassiveSocketBase@{$\sim$KPassiveSocketBase}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPassive\-Socket\-Base::$\sim${\bf KPassive\-Socket\-Base} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a1}


Destructor. 



Definition at line 325 of file ksocketbase.cpp.

\subsection{Member Function Documentation}
\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!bind@{bind}}
\index{bind@{bind}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KNetwork::KPassive\-Socket\-Base::bind (const {\bf KResolver\-Entry} \& {\em address})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a2}


Binds this socket to the given address. 

The socket will be constructed with the address family, socket type and protocol as those given in the {\tt address} object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]the address to bind to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the binding was successful, false otherwise \end{Desc}


Implemented in {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a15})}, {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a11})}, and {\bf KNetwork::KSocks\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocksSocketDevice_a4})}.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!listen@{listen}}
\index{listen@{listen}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KNetwork::KPassive\-Socket\-Base::listen (int {\em backlog})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a3}


Puts this socket into listening mode. 

Placing a socket in listening mode means that it will be allowed to receive incoming connections from remote hosts.

Note that some socket types or protocols cannot be put in listening mode.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em backlog}]the number of accepted connections to hold before starting to refuse \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the socket is now in listening mode \end{Desc}


Implemented in {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a16})}, {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a12})}, and {\bf KNetwork::KSocks\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocksSocketDevice_a5})}.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!close@{close}}
\index{close@{close}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KNetwork::KPassive\-Socket\-Base::close ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a4}


Closes this socket. 

All resources used are freed. Note that closing a passive socket does not close the connections accepted with it. 

Implemented in {\bf KNetwork::KHttp\-Proxy\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KHttpProxySocketDevice_a6})}, {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a17})}, and {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a7})}.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!accept@{accept}}
\index{accept@{accept}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf KActive\-Socket\-Base}$\ast$ KNetwork::KPassive\-Socket\-Base::accept ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a5}


Accepts a new incoming connection. 

If this socket was in listening mode, you can call this function to accept an incoming connection.

If this function cannot accept a new connection (either because it is not listening for one or because the operation would block), it will return NULL.

Also note that descended classes will override this function to return specialised socket classes. 

Implemented in {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a19})}, {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a14})}, and {\bf KNetwork::KSocks\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocksSocketDevice_a7})}.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!localAddress@{localAddress}}
\index{localAddress@{localAddress}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf KSocket\-Address} KNetwork::KPassive\-Socket\-Base::local\-Address () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a6}


Returns this socket's local address. 



Implemented in {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a20})}, {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a24})}, and {\bf KNetwork::KSocks\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocksSocketDevice_a14})}.\index{KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}!externalAddress@{externalAddress}}
\index{externalAddress@{externalAddress}!KNetwork::KPassiveSocketBase@{KNetwork::KPassive\-Socket\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf KSocket\-Address} KNetwork::KPassive\-Socket\-Base::external\-Address () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKNetwork_1_1KPassiveSocketBase_a7}


Returns this socket's externally-visible address if known. 



Implemented in {\bf KNetwork::KHttp\-Proxy\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KHttpProxySocketDevice_a10})}, {\bf KNetwork::KServer\-Socket} {\rm (p.\,\pageref{classKNetwork_1_1KServerSocket_a21})}, {\bf KNetwork::KSocket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocketDevice_a26})}, and {\bf KNetwork::KSocks\-Socket\-Device} {\rm (p.\,\pageref{classKNetwork_1_1KSocksSocketDevice_a16})}.

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