.TH "KIO::Connection" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KIO::Connection \- This class provides a simple means for IPC between two applications via a pipe.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <connection.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBConnection\fP ()"
.br
.ti -1c
.RI "void \fBinit\fP (KSocket *sock)"
.br
.ti -1c
.RI "void \fBinit\fP (int fd_in, int fd_out)"
.br
.ti -1c
.RI "void \fBconnect\fP (\fBQObject\fP *receiver=0, const char *member=0)"
.br
.ti -1c
.RI "void \fBclose\fP ()"
.br
.ti -1c
.RI "int \fBfd_from\fP () const "
.br
.ti -1c
.RI "int \fBfd_to\fP () const "
.br
.ti -1c
.RI "bool \fBinited\fP () const "
.br
.ti -1c
.RI "void \fBsend\fP (int cmd, const \fBQByteArray\fP &arr=\fBQByteArray\fP())"
.br
.ti -1c
.RI "bool \fBsendnow\fP (int _cmd, const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "int \fBread\fP (int *_cmd, \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "void \fBsuspend\fP ()"
.br
.ti -1c
.RI "void \fBresume\fP ()"
.br
.ti -1c
.RI "bool \fBsuspended\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBdequeue\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
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. 
.PP
Definition at line 49 of file connection.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "Connection::Connection ()"
.PP
Creates a new connection. 
.PP
\fBSee also:\fP
.RS 4
\fBinit()\fP
.RE
.PP

.PP
Definition at line 48 of file connection.cpp.
.PP
References QPtrList::setAutoDelete().
.SH "Member Function Documentation"
.PP 
.SS "void Connection::init (KSocket * sock)"
.PP
Initialize this connection to use the given socket. 
.PP
\fBParameters:\fP
.RS 4
\fIsock\fP the socket to use 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinited()\fP
.RE
.PP

.PP
Definition at line 124 of file connection.cpp.
.PP
References QObject::connect(), QSocketNotifier::socket(), and suspend().
.PP
Referenced by KIO::SlaveBase::connectSlave().
.SS "void Connection::init (int fd_in, int fd_out)"
.PP
Initialize the connection to use the given file descriptors. 
.PP
\fBParameters:\fP
.RS 4
\fIfd_in\fP the input file descriptor to use 
.br
\fIfd_out\fP the output file descriptor to use 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinited()\fP
.RE
.PP

.PP
Definition at line 144 of file connection.cpp.
.PP
References QObject::connect(), and suspend().
.SS "void Connection::close ()"
.PP
Closes the connection. 
.PP
Definition at line 79 of file connection.cpp.
.PP
References QPtrList::clear().
.SS "int KIO::Connection::fd_from () const\fC [inline]\fP"
.PP
Returns the input file descriptor. 
.PP
\fBReturns:\fP
.RS 4
the input file descriptor
.RE
.PP

.PP
Definition at line 82 of file connection.h.
.SS "int KIO::Connection::fd_to () const\fC [inline]\fP"
.PP
Returns the output file descriptor. 
.PP
\fBReturns:\fP
.RS 4
the output file descriptor
.RE
.PP

.PP
Definition at line 87 of file connection.h.
.SS "bool KIO::Connection::inited () const\fC [inline]\fP"
.PP
Checks whether the connection has been initialized. 
.PP
\fBReturns:\fP
.RS 4
true if the initialized 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinit()\fP
.RE
.PP

.PP
Definition at line 94 of file connection.h.
.PP
Referenced by KIO::SlaveBase::connectSlave(), and send().
.SS "void Connection::send (int cmd, const \fBQByteArray\fP & arr = \fC\fBQByteArray\fP()\fP)"
.PP
Sends/queues the given command to be sent. 
.PP
\fBParameters:\fP
.RS 4
\fIcmd\fP the command to set 
.br
\fIarr\fP the bytes to send
.RE
.PP

.PP
Definition at line 98 of file connection.cpp.
.PP
References QPtrList::append(), QPtrList::count(), inited(), and sendnow().
.SS "bool Connection::sendnow (int _cmd, const \fBQByteArray\fP & data)"
.PP
Sends the given command immediately. 
.PP
\fBParameters:\fP
.RS 4
\fI_cmd\fP the command to set 
.br
\fIdata\fP the bytes to send 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 175 of file connection.cpp.
.PP
References endl(), and kdError().
.PP
Referenced by KIO::SlaveInterface::messageBox(), KIO::SlaveInterface::openPassDlg(), and send().
.SS "int Connection::read (int * _cmd, \fBQByteArray\fP & data)"
.PP
Receive data. 
.PP
\fBParameters:\fP
.RS 4
\fI_cmd\fP the received command will be written here 
.br
\fIdata\fP the received data will be written here 
.RE
.PP
\fBReturns:\fP
.RS 4
>=0 indicates the received data size upon success -1 indicates error
.RE
.PP

.PP
Definition at line 206 of file connection.cpp.
.PP
References endl(), and kdError().
.SS "void Connection::suspend ()"
.PP
Don't handle incoming data until resumed. 
.PP
Definition at line 65 of file connection.cpp.
.PP
References QSocketNotifier::setEnabled().
.PP
Referenced by init(), and KIO::SlaveInterface::messageBox().
.SS "void Connection::resume ()"
.PP
Resume handling of incoming data. 
.PP
Definition at line 72 of file connection.cpp.
.PP
References QSocketNotifier::setEnabled().
.PP
Referenced by KIO::SlaveInterface::messageBox().
.SS "bool KIO::Connection::suspended () const\fC [inline]\fP"
.PP
Returns status of connection. 
.PP
\fBReturns:\fP
.RS 4
true if suspended, false otherwise 
.RE
.PP

.PP
Definition at line 135 of file connection.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
