\section{KIO::Connection Class Reference}
\label{classKIO_1_1Connection}\index{KIO::Connection@{KIO::Connection}}
This class provides a simple means for IPC between two applications via a pipe.  


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

Inheritance diagram for KIO::Connection:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=62pt]{classKIO_1_1Connection__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KIO::Connection:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=154pt]{classKIO_1_1Connection__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Connection} ()
\item 
void {\bf init} (KSocket $\ast$sock)
\item 
void {\bf init} (int fd\_\-in, int fd\_\-out)
\item 
void {\bf connect} ({\bf QObject} $\ast$receiver=0, const char $\ast$member=0)\label{classKIO_1_1Connection_a4}

\item 
void {\bf close} ()
\item 
int {\bf fd\_\-from} () const 
\item 
int {\bf fd\_\-to} () const 
\item 
bool {\bf inited} () const 
\item 
void {\bf send} (int cmd, const {\bf QByte\-Array} \&arr={\bf QByte\-Array}())
\item 
bool {\bf sendnow} (int \_\-cmd, const {\bf QByte\-Array} \&data)
\item 
int {\bf read} (int $\ast$\_\-cmd, {\bf QByte\-Array} \&data)
\item 
void {\bf suspend} ()
\item 
void {\bf resume} ()
\item 
bool {\bf suspended} () const 
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf dequeue} ()\label{classKIO_1_1Connection_j0}

\end{CompactItemize}


\subsection{Detailed Description}
This class provides a simple means for IPC between two applications via a pipe. 

It handles a queue of commands to be sent which makes it possible to queue data before an actual connection has been established. 



Definition at line 49 of file connection.h.

\subsection{Constructor \& Destructor Documentation}
\index{KIO::Connection@{KIO::Connection}!Connection@{Connection}}
\index{Connection@{Connection}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Connection::Connection ()}\label{classKIO_1_1Connection_a0}


Creates a new connection. 

\begin{Desc}
\item[See also:]{\bf init()}{\rm (p.\,\pageref{classKIO_1_1Connection_a2})}\end{Desc}


Definition at line 48 of file connection.cpp.

References QPtr\-List::set\-Auto\-Delete().

\subsection{Member Function Documentation}
\index{KIO::Connection@{KIO::Connection}!init@{init}}
\index{init@{init}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::init (KSocket $\ast$ {\em sock})}\label{classKIO_1_1Connection_a2}


Initialize this connection to use the given socket. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sock}]the socket to use \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf inited()}{\rm (p.\,\pageref{classKIO_1_1Connection_a8})}\end{Desc}


Definition at line 124 of file connection.cpp.

References QObject::connect(), QSocket\-Notifier::socket(), and suspend().

Referenced by KIO::Slave\-Base::connect\-Slave().\index{KIO::Connection@{KIO::Connection}!init@{init}}
\index{init@{init}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::init (int {\em fd\_\-in}, int {\em fd\_\-out})}\label{classKIO_1_1Connection_a3}


Initialize the connection to use the given file descriptors. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd\_\-in}]the input file descriptor to use \item[{\em fd\_\-out}]the output file descriptor to use \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf inited()}{\rm (p.\,\pageref{classKIO_1_1Connection_a8})}\end{Desc}


Definition at line 144 of file connection.cpp.

References QObject::connect(), and suspend().\index{KIO::Connection@{KIO::Connection}!close@{close}}
\index{close@{close}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::close ()}\label{classKIO_1_1Connection_a5}


Closes the connection. 



Definition at line 79 of file connection.cpp.

References QPtr\-List::clear().\index{KIO::Connection@{KIO::Connection}!fd_from@{fd\_\-from}}
\index{fd_from@{fd\_\-from}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KIO::Connection::fd\_\-from () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIO_1_1Connection_a6}


Returns the input file descriptor. 

\begin{Desc}
\item[Returns:]the input file descriptor\end{Desc}


Definition at line 82 of file connection.h.\index{KIO::Connection@{KIO::Connection}!fd_to@{fd\_\-to}}
\index{fd_to@{fd\_\-to}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KIO::Connection::fd\_\-to () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIO_1_1Connection_a7}


Returns the output file descriptor. 

\begin{Desc}
\item[Returns:]the output file descriptor\end{Desc}


Definition at line 87 of file connection.h.\index{KIO::Connection@{KIO::Connection}!inited@{inited}}
\index{inited@{inited}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIO::Connection::inited () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIO_1_1Connection_a8}


Checks whether the connection has been initialized. 

\begin{Desc}
\item[Returns:]true if the initialized \end{Desc}
\begin{Desc}
\item[See also:]{\bf init()}{\rm (p.\,\pageref{classKIO_1_1Connection_a2})}\end{Desc}


Definition at line 94 of file connection.h.

Referenced by KIO::Slave\-Base::connect\-Slave(), and send().\index{KIO::Connection@{KIO::Connection}!send@{send}}
\index{send@{send}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::send (int {\em cmd}, const {\bf QByte\-Array} \& {\em arr} = {\tt {\bf QByte\-Array}()})}\label{classKIO_1_1Connection_a9}


Sends/queues the given command to be sent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]the command to set \item[{\em arr}]the bytes to send\end{description}
\end{Desc}


Definition at line 98 of file connection.cpp.

References QPtr\-List::append(), QPtr\-List::count(), inited(), and sendnow().\index{KIO::Connection@{KIO::Connection}!sendnow@{sendnow}}
\index{sendnow@{sendnow}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Connection::sendnow (int {\em \_\-cmd}, const {\bf QByte\-Array} \& {\em data})}\label{classKIO_1_1Connection_a10}


Sends the given command immediately. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-cmd}]the command to set \item[{\em data}]the bytes to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 175 of file connection.cpp.

References endl(), and kd\-Error().

Referenced by KIO::Slave\-Interface::message\-Box(), KIO::Slave\-Interface::open\-Pass\-Dlg(), and send().\index{KIO::Connection@{KIO::Connection}!read@{read}}
\index{read@{read}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Connection::read (int $\ast$ {\em \_\-cmd}, {\bf QByte\-Array} \& {\em data})}\label{classKIO_1_1Connection_a11}


Receive data. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-cmd}]the received command will be written here \item[{\em data}]the received data will be written here \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]$>$=0 indicates the received data size upon success -1 indicates error\end{Desc}


Definition at line 206 of file connection.cpp.

References endl(), and kd\-Error().\index{KIO::Connection@{KIO::Connection}!suspend@{suspend}}
\index{suspend@{suspend}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::suspend ()}\label{classKIO_1_1Connection_a12}


Don't handle incoming data until resumed. 



Definition at line 65 of file connection.cpp.

References QSocket\-Notifier::set\-Enabled().

Referenced by init(), and KIO::Slave\-Interface::message\-Box().\index{KIO::Connection@{KIO::Connection}!resume@{resume}}
\index{resume@{resume}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Connection::resume ()}\label{classKIO_1_1Connection_a13}


Resume handling of incoming data. 



Definition at line 72 of file connection.cpp.

References QSocket\-Notifier::set\-Enabled().

Referenced by KIO::Slave\-Interface::message\-Box().\index{KIO::Connection@{KIO::Connection}!suspended@{suspended}}
\index{suspended@{suspended}!KIO::Connection@{KIO::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIO::Connection::suspended () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIO_1_1Connection_a14}


Returns status of connection. 

\begin{Desc}
\item[Returns:]true if suspended, false otherwise \end{Desc}


Definition at line 135 of file connection.h.

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