.TH "KNetwork::KActiveSocketBase" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KNetwork::KActiveSocketBase \- Abstract class for active sockets.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ksocketbase.h>\fP
.PP
Inherits \fBQIODevice\fP, and \fBKNetwork::KSocketBase\fP.
.PP
Inherited by \fBKNetwork::KClientSocketBase\fP, and \fBKNetwork::KSocketDevice\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKActiveSocketBase\fP ()"
.br
.ti -1c
.RI "virtual \fB~KActiveSocketBase\fP ()"
.br
.ti -1c
.RI "virtual bool \fBbind\fP (const \fBKResolverEntry\fP &address)=0"
.br
.ti -1c
.RI "virtual bool \fBconnect\fP (const \fBKResolverEntry\fP &address)=0"
.br
.ti -1c
.RI "virtual bool \fBdisconnect\fP ()=0"
.br
.ti -1c
.RI "virtual \fBOffset\fP \fBsize\fP () const "
.br
.ti -1c
.RI "virtual \fBOffset\fP \fBat\fP () const "
.br
.ti -1c
.RI "virtual bool \fBat\fP (\fBOffset\fP)"
.br
.ti -1c
.RI "virtual bool \fBatEnd\fP () const "
.br
.ti -1c
.RI "virtual Q_LONG \fBbytesAvailable\fP () const =0"
.br
.ti -1c
.RI "virtual Q_LONG \fBwaitForMore\fP (int msecs, bool *timeout=0L)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBreadBlock\fP (char *data, Q_ULONG len)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBreadBlock\fP (char *data, Q_ULONG maxlen, \fBKSocketAddress\fP &from)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBpeekBlock\fP (char *data, Q_ULONG maxlen)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBpeekBlock\fP (char *data, Q_ULONG maxlen, \fBKSocketAddress\fP &from)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBwriteBlock\fP (const char *data, Q_ULONG len)=0"
.br
.ti -1c
.RI "virtual Q_LONG \fBwriteBlock\fP (const char *data, Q_ULONG len, const \fBKSocketAddress\fP &to)=0"
.br
.ti -1c
.RI "virtual int \fBgetch\fP ()"
.br
.ti -1c
.RI "virtual int \fBputch\fP (int ch)"
.br
.ti -1c
.RI "virtual int \fBungetch\fP (int)"
.br
.ti -1c
.RI "virtual \fBKSocketAddress\fP \fBlocalAddress\fP () const =0"
.br
.ti -1c
.RI "virtual \fBKSocketAddress\fP \fBpeerAddress\fP () const =0"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBsetError\fP (int \fBstatus\fP, \fBSocketError\fP error)"
.br
.ti -1c
.RI "void \fBresetError\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Abstract class for active sockets. 

This class provides the standard interfaces for active sockets, i.e., sockets that are used to connect to external addresses.
.PP
\fBAuthor:\fP
.RS 4
Thiago Macieira <thiago.macieira@kdemail.net> 
.RE
.PP

.PP
Definition at line 443 of file ksocketbase.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KActiveSocketBase::KActiveSocketBase ()"
.PP
Constructor. 
.PP
Definition at line 283 of file ksocketbase.cpp.
.SS "KActiveSocketBase::~\fBKActiveSocketBase\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 287 of file ksocketbase.cpp.
.SH "Member Function Documentation"
.PP 
.SS "virtual bool KNetwork::KActiveSocketBase::bind (const \fBKResolverEntry\fP & address)\fC [pure virtual]\fP"
.PP
Binds this socket to the given address. 
.PP
The socket will be constructed with the address family, socket type and protocol as those given in the \fCaddress\fP object.
.PP
\fBParameters:\fP
.RS 4
\fIaddress\fP the address to bind to 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the binding was successful, false otherwise 
.RE
.PP

.PP
Implemented in \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KDatagramSocket\fP, \fBKNetwork::KSocketDevice\fP, \fBKNetwork::KSocksSocketDevice\fP, and \fBKNetwork::KStreamSocket\fP.
.SS "virtual bool KNetwork::KActiveSocketBase::connect (const \fBKResolverEntry\fP & address)\fC [pure virtual]\fP"
.PP
Connect to a remote host. 
.PP
This will make this socket try to connect to the remote host. If the socket is not yet created, it will be created using the address family, socket type and protocol specified in the \fCaddress\fP object.
.PP
If this function returns with error InProgress, calling it again with the same address after a time will cause it to test if the connection has succeeded in the mean time.
.PP
\fBParameters:\fP
.RS 4
\fIaddress\fP the address to connect to 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the connection was successful or has been successfully queued; false if an error occurred. 
.RE
.PP

.PP
Implemented in \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KDatagramSocket\fP, \fBKNetwork::KHttpProxySocketDevice\fP, \fBKNetwork::KMulticastSocketImpl\fP, \fBKNetwork::KSocketDevice\fP, \fBKNetwork::KSocksSocketDevice\fP, and \fBKNetwork::KStreamSocket\fP.
.SS "virtual bool KNetwork::KActiveSocketBase::disconnect ()\fC [pure virtual]\fP"
.PP
Disconnects this socket from a connection, if possible. 
.PP
If this socket was connected to an endpoint, the connection is severed, but the socket is not closed. If the socket wasn't connected, this function does nothing.
.PP
If the socket hadn't yet been created, this function does nothing either.
.PP
Not all socket types can disconnect. Most notably, only connectionless datagram protocols such as UDP support this operation.
.PP
\fBReturns:\fP
.RS 4
true if the socket is now disconnected or false on error. 
.RE
.PP

.PP
Implemented in \fBKNetwork::KClientSocketBase\fP, and \fBKNetwork::KSocketDevice\fP.
.SS "virtual \fBOffset\fP KNetwork::KActiveSocketBase::size () const\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. This will always return 0. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 507 of file ksocketbase.h.
.SS "virtual \fBOffset\fP KNetwork::KActiveSocketBase::at () const\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. This will always return 0. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 514 of file ksocketbase.h.
.SS "virtual bool KNetwork::KActiveSocketBase::at (\fBOffset\fP)\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. This will always return false. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 521 of file ksocketbase.h.
.SS "virtual bool KNetwork::KActiveSocketBase::atEnd () const\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. This will always return true. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 528 of file ksocketbase.h.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::bytesAvailable () const\fC [pure virtual]\fP"
.PP
Returns the number of bytes available for reading without blocking. 
.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, and \fBKNetwork::KSocketDevice\fP.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::waitForMore (int msecs, bool * timeout = \fC0L\fP)\fC [pure virtual]\fP"
.PP
Waits up to \fCmsecs\fP for more data to be available on this socket. 
.PP
If msecs is -1, this call will block indefinetely until more data is indeed available; if it's 0, this function returns immediately.
.PP
If \fCtimeout\fP is not NULL, this function will set it to indicate if a timeout occurred.
.PP
\fBReturns:\fP
.RS 4
the number of bytes available 
.RE
.PP

.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, and \fBKNetwork::KSocketDevice\fP.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::readBlock (char * data, Q_ULONG len)\fC [pure virtual]\fP"
.PP
Reads data from the socket. 
.PP
Reimplemented from \fBQIODevice\fP. See \fBQIODevice::readBlock\fP for more information. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.PP
Referenced by getch().
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::readBlock (char * data, Q_ULONG maxlen, \fBKSocketAddress\fP & from)\fC [pure virtual]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Receives data and the source address.
.PP
This call will read data in the socket and will also place the sender's address in \fCfrom\fP object.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP where to write the read data to 
.br
\fImaxlen\fP the maximum number of bytes to read 
.br
\fIfrom\fP the address of the sender will be stored here 
.RE
.PP
\fBReturns:\fP
.RS 4
the actual number of bytes read 
.RE
.PP

.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::peekBlock (char * data, Q_ULONG maxlen)\fC [pure virtual]\fP"
.PP
Peeks the data in the socket. 
.PP
This call will allow you to peek the data to be received without actually receiving it -- that is, it will be available for further peekings and for the next read call.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP where to write the peeked data to 
.br
\fImaxlen\fP the maximum number of bytes to peek 
.RE
.PP
\fBReturns:\fP
.RS 4
the actual number of bytes copied into \fCdata\fP 
.RE
.PP

.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::peekBlock (char * data, Q_ULONG maxlen, \fBKSocketAddress\fP & from)\fC [pure virtual]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Peeks the data in the socket and the source address.
.PP
This call will allow you to peek the data to be received without actually receiving it -- that is, it will be available for further peekings and for the next read call.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP where to write the peeked data to 
.br
\fImaxlen\fP the maximum number of bytes to peek 
.br
\fIfrom\fP the address of the sender will be stored here 
.RE
.PP
\fBReturns:\fP
.RS 4
the actual number of bytes copied into \fCdata\fP 
.RE
.PP

.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::writeBlock (const char * data, Q_ULONG len)\fC [pure virtual]\fP"
.PP
Writes the given data to the socket. 
.PP
Reimplemented from \fBQIODevice\fP. See \fBQIODevice::writeBlock\fP for more information. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.PP
Referenced by putch().
.SS "virtual Q_LONG KNetwork::KActiveSocketBase::writeBlock (const char * data, Q_ULONG len, const \fBKSocketAddress\fP & to)\fC [pure virtual]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Writes the given data to the destination address.
.PP
Note that not all socket connections allow sending data to different addresses than the one the socket is connected to.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP the data to write 
.br
\fIlen\fP the length of the data 
.br
\fIto\fP the address to send to 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes actually sent 
.RE
.PP

.PP
Implemented in \fBKNetwork::KBufferedSocket\fP, \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "int KActiveSocketBase::getch ()\fC [virtual]\fP"
.PP
Reads one character from the socket. 
.PP
Reimplementation from \fBQIODevice\fP. See \fBQIODevice::getch\fP for more information. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 291 of file ksocketbase.cpp.
.PP
References readBlock().
.SS "int KActiveSocketBase::putch (int ch)\fC [virtual]\fP"
.PP
Writes one character to the socket. 
.PP
Reimplementation from \fBQIODevice\fP. See \fBQIODevice::putch\fP for more information. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 300 of file ksocketbase.cpp.
.PP
References writeBlock().
.SS "virtual int KNetwork::KActiveSocketBase::ungetch (int)\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. This will always return -1; 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 635 of file ksocketbase.h.
.SS "virtual \fBKSocketAddress\fP KNetwork::KActiveSocketBase::localAddress () const\fC [pure virtual]\fP"
.PP
Returns this socket's local address. 
.PP
Implemented in \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "virtual \fBKSocketAddress\fP KNetwork::KActiveSocketBase::peerAddress () const\fC [pure virtual]\fP"
.PP
Return this socket's peer address, if we are connected. 
.PP
If the address cannot be retrieved, the returned object will contain an invalid address. 
.PP
Implemented in \fBKNetwork::KClientSocketBase\fP, \fBKNetwork::KHttpProxySocketDevice\fP, \fBKNetwork::KSocketDevice\fP, and \fBKNetwork::KSocksSocketDevice\fP.
.SS "void KActiveSocketBase::setError (int status, \fBSocketError\fP error)\fC [protected]\fP"
.PP
Sets the socket's error code and the I/O Device's status. 
.PP
\fBParameters:\fP
.RS 4
\fIstatus\fP the I/O Device status 
.br
\fIerror\fP the error code 
.RE
.PP

.PP
Definition at line 309 of file ksocketbase.cpp.
.PP
Referenced by KNetwork::KSocksSocketDevice::accept(), KNetwork::KSocketDevice::accept(), KNetwork::KSocksSocketDevice::bind(), KNetwork::KSocketDevice::bind(), KNetwork::KStreamSocket::connect(), KNetwork::KSocksSocketDevice::connect(), KNetwork::KSocketDevice::connect(), KNetwork::KHttpProxySocketDevice::connect(), KNetwork::KClientSocketBase::copyError(), KNetwork::KSocketDevice::create(), KNetwork::KSocketDevice::disconnect(), KNetwork::KSocksSocketDevice::listen(), KNetwork::KSocketDevice::listen(), KNetwork::KSocksSocketDevice::peekBlock(), KNetwork::KSocketDevice::peekBlock(), KNetwork::KBufferedSocket::peekBlock(), KNetwork::KSocksSocketDevice::poll(), KNetwork::KSocketDevice::poll(), KNetwork::KSocksSocketDevice::readBlock(), KNetwork::KSocketDevice::readBlock(), KNetwork::KBufferedSocket::readBlock(), KNetwork::KDatagramSocket::receive(), KNetwork::KSocketDevice::setSocketOptions(), KNetwork::KBufferedSocket::slotReadActivity(), KNetwork::KBufferedSocket::slotWriteActivity(), KNetwork::KSocksSocketDevice::writeBlock(), KNetwork::KSocketDevice::writeBlock(), and KNetwork::KBufferedSocket::writeBlock().
.SS "void KActiveSocketBase::resetError ()\fC [protected]\fP"
.PP
Resets the socket error code and the I/O Device's status. 
.PP
Definition at line 315 of file ksocketbase.cpp.
.PP
References QIODevice::resetStatus().
.PP
Referenced by KNetwork::KSocksSocketDevice::bind(), KNetwork::KSocketDevice::bind(), KNetwork::KClientSocketBase::bind(), KNetwork::KSocketDevice::close(), KNetwork::KSocksSocketDevice::connect(), KNetwork::KSocketDevice::connect(), KNetwork::KHttpProxySocketDevice::connect(), KNetwork::KSocketDevice::create(), KNetwork::KSocketDevice::disconnect(), KNetwork::KSocksSocketDevice::listen(), KNetwork::KSocketDevice::listen(), KNetwork::KSocketDevice::open(), KNetwork::KSocksSocketDevice::peekBlock(), KNetwork::KSocketDevice::peekBlock(), KNetwork::KClientSocketBase::peekBlock(), KNetwork::KBufferedSocket::peekBlock(), KNetwork::KSocksSocketDevice::poll(), KNetwork::KSocketDevice::poll(), KNetwork::KSocksSocketDevice::readBlock(), KNetwork::KSocketDevice::readBlock(), KNetwork::KClientSocketBase::readBlock(), KNetwork::KBufferedSocket::readBlock(), KNetwork::KClientSocketBase::waitForMore(), KNetwork::KBufferedSocket::waitForMore(), KNetwork::KSocksSocketDevice::writeBlock(), KNetwork::KSocketDevice::writeBlock(), KNetwork::KClientSocketBase::writeBlock(), and KNetwork::KBufferedSocket::writeBlock().

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