.TH "KNetwork::KClientSocketBase" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KNetwork::KClientSocketBase \- Abstract client socket class.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kclientsocketbase.h>\fP
.PP
Inherits \fBQObject\fP, and \fBKNetwork::KActiveSocketBase\fP.
.PP
Inherited by \fBKNetwork::KDatagramSocket\fP, and \fBKNetwork::KStreamSocket\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBSocketState\fP { \fBIdle\fP, \fBHostLookup\fP, \fBHostFound\fP, \fBBound\fP, \fBConnecting\fP, \fBOpen\fP, \fBClosing\fP, \fBUnconnected\fP =  Bound, \fBConnected\fP =  Open, \fBConnection\fP =  Open }"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBstateChanged\fP (int newstate)"
.br
.ti -1c
.RI "void \fBgotError\fP (int code)"
.br
.ti -1c
.RI "void \fBhostFound\fP ()"
.br
.ti -1c
.RI "void \fBbound\fP (const \fBKResolverEntry\fP &local)"
.br
.ti -1c
.RI "void \fBaboutToConnect\fP (const \fBKResolverEntry\fP &remote, bool &skip)"
.br
.ti -1c
.RI "void \fBconnected\fP (const \fBKResolverEntry\fP &remote)"
.br
.ti -1c
.RI "void \fBclosed\fP ()"
.br
.ti -1c
.RI "void \fBreadyRead\fP ()"
.br
.ti -1c
.RI "void \fBreadyWrite\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKClientSocketBase\fP (\fBQObject\fP *\fBparent\fP, const char *\fBname\fP)"
.br
.ti -1c
.RI "virtual \fB~KClientSocketBase\fP ()"
.br
.ti -1c
.RI "\fBSocketState\fP \fBstate\fP () const "
.br
.ti -1c
.RI "\fBKResolver\fP & \fBpeerResolver\fP () const "
.br
.ti -1c
.RI "const \fBKResolverResults\fP & \fBpeerResults\fP () const "
.br
.ti -1c
.RI "\fBKResolver\fP & \fBlocalResolver\fP () const "
.br
.ti -1c
.RI "const \fBKResolverResults\fP & \fBlocalResults\fP () const "
.br
.ti -1c
.RI "void \fBsetResolutionEnabled\fP (bool enable)"
.br
.ti -1c
.RI "void \fBsetFamily\fP (int families)"
.br
.ti -1c
.RI "virtual bool \fBlookup\fP ()"
.br
.ti -1c
.RI "virtual bool \fBbind\fP (const \fBQString\fP &node=QString::null, const \fBQString\fP &service=QString::null)=0"
.br
.ti -1c
.RI "virtual bool \fBbind\fP (const \fBKResolverEntry\fP &address)"
.br
.ti -1c
.RI "virtual bool \fBconnect\fP (const \fBQString\fP &node=QString::null, const \fBQString\fP &service=QString::null)=0"
.br
.ti -1c
.RI "virtual bool \fBconnect\fP (const \fBKResolverEntry\fP &address)"
.br
.ti -1c
.RI "void \fBconnectToHost\fP (const \fBQString\fP &host, Q_UINT16 port)"
.br
.ti -1c
.RI "virtual bool \fBdisconnect\fP ()"
.br
.ti -1c
.RI "virtual bool \fBopen\fP (int)"
.br
.ti -1c
.RI "virtual void \fBclose\fP ()"
.br
.ti -1c
.RI "virtual void \fBflush\fP ()"
.br
.ti -1c
.RI "virtual Q_LONG \fBbytesAvailable\fP () const "
.br
.ti -1c
.RI "virtual Q_LONG \fBwaitForMore\fP (int msecs, bool *timeout=0L)"
.br
.ti -1c
.RI "virtual Q_LONG \fBreadBlock\fP (char *data, Q_ULONG maxlen)"
.br
.ti -1c
.RI "virtual Q_LONG \fBreadBlock\fP (char *data, Q_ULONG maxlen, \fBKSocketAddress\fP &from)"
.br
.ti -1c
.RI "virtual Q_LONG \fBpeekBlock\fP (char *data, Q_ULONG maxlen)"
.br
.ti -1c
.RI "virtual Q_LONG \fBpeekBlock\fP (char *data, Q_ULONG maxlen, \fBKSocketAddress\fP &from)"
.br
.ti -1c
.RI "virtual Q_LONG \fBwriteBlock\fP (const char *data, Q_ULONG len)"
.br
.ti -1c
.RI "virtual Q_LONG \fBwriteBlock\fP (const char *data, Q_ULONG len, const \fBKSocketAddress\fP &to)"
.br
.ti -1c
.RI "virtual \fBKSocketAddress\fP \fBlocalAddress\fP () const "
.br
.ti -1c
.RI "virtual \fBKSocketAddress\fP \fBpeerAddress\fP () const "
.br
.ti -1c
.RI "bool \fBemitsReadyRead\fP () const "
.br
.ti -1c
.RI "virtual void \fBenableRead\fP (bool enable)"
.br
.ti -1c
.RI "bool \fBemitsReadyWrite\fP () const "
.br
.ti -1c
.RI "virtual void \fBenableWrite\fP (bool enable)"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotReadActivity\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotWriteActivity\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBsetSocketOptions\fP (int opts)"
.br
.ti -1c
.RI "void \fBsetState\fP (\fBSocketState\fP state)"
.br
.ti -1c
.RI "virtual void \fBstateChanging\fP (\fBSocketState\fP newState)"
.br
.ti -1c
.RI "void \fBcopyError\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Abstract client socket class. 

This class provides the base functionality for client sockets, such as, and especially, name resolution and signals.
.PP
\fBNote:\fP
.RS 4
This class is abstract. If you're looking for a normal, client socket class, see \fBKStreamSocket\fP and \fBKBufferedSocket\fP
.RE
.PP
\fBAuthor:\fP
.RS 4
Thiago Macieira <thiago.macieira@kdemail.net> 
.RE
.PP

.PP
Definition at line 49 of file kclientsocketbase.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKNetwork::KClientSocketBase::SocketState\fP"
.PP
Socket states. 
.PP
These are the possible states for a \fBKClientSocketBase\fP:
.IP "\(bu" 2
Idle: socket is not connected
.IP "\(bu" 2
HostLookup: socket is doing host lookup prior to connecting
.IP "\(bu" 2
HostFound: name lookup is complete
.IP "\(bu" 2
Bound: the socket is locally bound
.IP "\(bu" 2
Connecting: socket is attempting connection
.IP "\(bu" 2
Open: socket is open
.IP "\(bu" 2
Connected (=Open): socket is connected
.IP "\(bu" 2
Connection (=Open): yet another name for a connected socket
.IP "\(bu" 2
Closing: socket is shutting down
.PP
.PP
Whenever the socket state changes, the \fBstateChanged(int)\fP signal will be emitted. 
.PP
Definition at line 71 of file kclientsocketbase.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KClientSocketBase::KClientSocketBase (\fBQObject\fP * parent, const char * name)"
.PP
Default constructor. 
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP the parent \fBQObject\fP object 
.br
\fIname\fP the name of this object 
.RE
.PP

.PP
Definition at line 50 of file kclientsocketbase.cpp.
.SS "KClientSocketBase::~\fBKClientSocketBase\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 58 of file kclientsocketbase.cpp.
.PP
References close().
.SH "Member Function Documentation"
.PP 
.SS "\fBKClientSocketBase::SocketState\fP KClientSocketBase::state () const"
.PP
Returns the current state for this socket. 
.PP
\fBSee also:\fP
.RS 4
\fBSocketState\fP 
.RE
.PP

.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 64 of file kclientsocketbase.cpp.
.PP
Referenced by KNetwork::KStreamSocket::bind(), KNetwork::KDatagramSocket::bind(), bind(), close(), KNetwork::KStreamSocket::connect(), KNetwork::KDatagramSocket::connect(), connect(), disconnect(), KNetwork::KBufferedSocket::enableRead(), lookup(), KNetwork::KStreamSocket::remainingTimeout(), KNetwork::KStreamSocket::setTimeout(), KNetwork::KBufferedSocket::slotReadActivity(), KNetwork::KBufferedSocket::slotWriteActivity(), and KNetwork::KBufferedSocket::writeBlock().
.SS "bool KClientSocketBase::setSocketOptions (int opts)\fC [protected, virtual]\fP"
.PP
Sets the socket options. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Reimplemented from \fBKNetwork::KSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 75 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::hasDevice(), KNetwork::KSocketBase::mutex(), KNetwork::KSocketDevice::setSocketOptions(), and KNetwork::KSocketBase::socketDevice().
.PP
Referenced by KNetwork::KStreamSocket::KStreamSocket().
.SS "\fBKResolver\fP & KClientSocketBase::peerResolver () const"
.PP
Returns the internal \fBKResolver\fP object used for looking up the peer host name and service. 
.PP
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. 
.PP
Definition at line 91 of file kclientsocketbase.cpp.
.PP
Referenced by KNetwork::KStreamSocket::connect(), KNetwork::KDatagramSocket::connect(), KNetwork::KDatagramSocket::KDatagramSocket(), KNetwork::KStreamSocket::KStreamSocket(), and lookup().
.SS "const \fBKResolverResults\fP & KClientSocketBase::peerResults () const"
.PP
Returns the internal list of resolved results for the peer address. 
.PP
Definition at line 96 of file kclientsocketbase.cpp.
.SS "\fBKResolver\fP & KClientSocketBase::localResolver () const"
.PP
Returns the internal \fBKResolver\fP object used for looking up the local host name and service. 
.PP
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. 
.PP
Definition at line 101 of file kclientsocketbase.cpp.
.PP
Referenced by KNetwork::KStreamSocket::bind(), KNetwork::KDatagramSocket::bind(), KNetwork::KDatagramSocket::KDatagramSocket(), KNetwork::KStreamSocket::KStreamSocket(), and lookup().
.SS "const \fBKResolverResults\fP & KClientSocketBase::localResults () const"
.PP
Returns the internal list of resolved results for the local address. 
.PP
Definition at line 106 of file kclientsocketbase.cpp.
.SS "void KClientSocketBase::setResolutionEnabled (bool enable)"
.PP
Enables or disables name resolution. 
.PP
If this flag is set to true, \fBbind\fP and \fBconnect\fP 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.
.PP
This is useful, for instance, when IP addresses are in their string representation (such as '1.2.3.4') or come from other sources like \fBKSocketAddress\fP.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP whether to enable 
.RE
.PP

.PP
Definition at line 111 of file kclientsocketbase.cpp.
.SS "void KClientSocketBase::setFamily (int families)"
.PP
Sets the allowed families for the resolutions. 
.PP
\fBParameters:\fP
.RS 4
\fIfamilies\fP the families that we want/accept 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKResolver::SocketFamilies\fP for possible values 
.RE
.PP

.PP
Definition at line 125 of file kclientsocketbase.cpp.
.SS "bool KClientSocketBase::lookup ()\fC [virtual]\fP"
.PP
Starts the lookup for peer and local hostnames as well as their services. 
.PP
If the blocking mode for this object is on, this function will wait for the lookup results to be available (by calling the \fBKResolver::wait\fP method on the resolver objects).
.PP
When the lookup is done, the signal \fBhostFound\fP will be emitted (only once, even if we're doing a double lookup). If the lookup failed (for any of the two lookups) the \fBgotError\fP signal will be emitted with the appropriate error condition (see \fBKSocketBase::SocketError\fP).
.PP
This function returns true on success and false on error. Note that this is not the lookup result! 
.PP
Definition at line 131 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketBase::blocking(), QObject::connect(), localResolver(), peerResolver(), setState(), QTimer::singleShot(), state(), stateChanged(), and KNetwork::KResolver::wait().
.PP
Referenced by KNetwork::KDatagramSocket::bind(), KNetwork::KStreamSocket::connect(), and KNetwork::KDatagramSocket::connect().
.SS "virtual bool KNetwork::KClientSocketBase::bind (const \fBQString\fP & node = \fCQString::null\fP, const \fBQString\fP & service = \fCQString::null\fP)\fC [pure virtual]\fP"
.PP
Binds this socket to the given nodename and service, or use the default ones if none are given. 
.PP
Upon successful binding, the \fBbound\fP signal will be emitted. If an error is found, the \fBgotError\fP signal will be emitted.
.PP
\fBNote:\fP
.RS 4
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 \fBconnect\fP). They only set the values for future reference.
.RE
.PP
This function returns true on success.
.PP
\fBParameters:\fP
.RS 4
\fInode\fP the nodename 
.br
\fIservice\fP the service 
.RE
.PP

.PP
Implemented in \fBKNetwork::KDatagramSocket\fP, and \fBKNetwork::KStreamSocket\fP.
.PP
Referenced by bind().
.SS "bool KClientSocketBase::bind (const \fBKResolverEntry\fP & address)\fC [virtual]\fP"
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Connect this socket to this specific address.
.PP
Unlike \fBbind(const QString&, const QString&)\fP above, this function really does bind the socket. No lookup is performed. The \fBbound\fP signal will be emitted. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KDatagramSocket\fP, and \fBKNetwork::KStreamSocket\fP.
.PP
Definition at line 189 of file kclientsocketbase.cpp.
.PP
References bind(), bound(), KNetwork::KActiveSocketBase::resetError(), setState(), KNetwork::KSocketBase::socketDevice(), state(), and stateChanged().
.SS "virtual bool KNetwork::KClientSocketBase::connect (const \fBQString\fP & node = \fCQString::null\fP, const \fBQString\fP & service = \fCQString::null\fP)\fC [pure virtual]\fP"
.PP
Attempts to connect to the these hostname and service, or use the default ones if none are given. 
.PP
If a connection attempt is already in progress, check on its state and set the error status (NoError or InProgress).
.PP
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.
.PP
Upon successfully connecting, the \fBconnected\fP signal will be emitted. If an error is found, the \fBgotError\fP signal will be emitted.
.PP
\fBNote for derived classes:\fP.RS 4
Derived classes must implement this function. The implementation will set the parameters for the lookup (using the peer \fBKResolver\fP object) and call \fBlookup\fP to start it.
.RE
.PP
\fB\fP.RS 4
The implementation should use the \fBhostFound\fP 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 \fBblocking\fP flag.
.RE
.PP
\fBParameters:\fP
.RS 4
\fInode\fP the nodename 
.br
\fIservice\fP the service 
.RE
.PP

.PP
Implemented in \fBKNetwork::KDatagramSocket\fP, and \fBKNetwork::KStreamSocket\fP.
.SS "bool KClientSocketBase::connect (const \fBKResolverEntry\fP & address)\fC [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
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KDatagramSocket\fP, and \fBKNetwork::KStreamSocket\fP.
.PP
Definition at line 210 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketDevice::connect(), connected(), copyError(), KNetwork::KSocketBase::error(), setState(), KNetwork::KSocketBase::socketDevice(), state(), and stateChanged().
.SS "void KNetwork::KClientSocketBase::connectToHost (const \fBQString\fP & host, Q_UINT16 port)\fC [inline]\fP"
.PP
\fBDeprecated\fP
.RS 4
This is a convenience function provided to ease migrating from \fBQt\fP 3.x's \fBQSocket\fP class. 
.RE
.PP

.PP
Definition at line 260 of file kclientsocketbase.h.
.SS "bool KClientSocketBase::disconnect ()\fC [virtual]\fP"
.PP
Disconnects the socket. 
.PP
Note that not all socket types can disconnect. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Definition at line 244 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketDevice::disconnect(), setState(), KNetwork::KSocketBase::socketDevice(), state(), and stateChanged().
.SS "virtual bool KNetwork::KClientSocketBase::open (int)\fC [inline, virtual]\fP"
.PP
Opens the socket. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
You should not call this function; instead, use \fBconnect\fP 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 274 of file kclientsocketbase.h.
.SS "void KClientSocketBase::close ()\fC [virtual]\fP"
.PP
Closes the socket. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
The closing of the socket causes the emission of the signal \fBclosed\fP. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 261 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketDevice::close(), closed(), setState(), KNetwork::KSocketBase::socketDevice(), state(), and stateChanged().
.PP
Referenced by ~KClientSocketBase().
.SS "virtual void KNetwork::KClientSocketBase::flush ()\fC [inline, virtual]\fP"
.PP
This call is not supported on sockets. 
.PP
Reimplemented from \fBQIODevice\fP. 
.PP
Reimplemented from \fBQIODevice\fP.
.PP
Definition at line 288 of file kclientsocketbase.h.
.SS "Q_LONG KClientSocketBase::bytesAvailable () const\fC [virtual]\fP"
.PP
Returns the number of bytes available on this socket. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 281 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketDevice::bytesAvailable(), and KNetwork::KSocketBase::socketDevice().
.PP
Referenced by KNetwork::KDatagramSocket::receive().
.SS "Q_LONG KClientSocketBase::waitForMore (int msecs, bool * timeout = \fC0L\fP)\fC [virtual]\fP"
.PP
Waits for more data. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 289 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KActiveSocketBase::resetError(), KNetwork::KSocketBase::socketDevice(), and KNetwork::KSocketDevice::waitForMore().
.SS "Q_LONG KClientSocketBase::readBlock (char * data, Q_ULONG maxlen)\fC [virtual]\fP"
.PP
Reads data from a socket. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 301 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KSocketDevice::readBlock(), KNetwork::KActiveSocketBase::resetError(), and KNetwork::KSocketBase::socketDevice().
.PP
Referenced by KNetwork::KDatagramSocket::receive().
.SS "Q_LONG KClientSocketBase::readBlock (char * data, Q_ULONG maxlen, \fBKSocketAddress\fP & from)\fC [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
Reads data from a socket. Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 313 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KSocketDevice::readBlock(), KNetwork::KActiveSocketBase::resetError(), and KNetwork::KSocketBase::socketDevice().
.SS "Q_LONG KClientSocketBase::peekBlock (char * data, Q_ULONG maxlen)\fC [virtual]\fP"
.PP
Peeks data from the socket. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 325 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KSocketDevice::peekBlock(), KNetwork::KActiveSocketBase::resetError(), and KNetwork::KSocketBase::socketDevice().
.SS "Q_LONG KClientSocketBase::peekBlock (char * data, Q_ULONG maxlen, \fBKSocketAddress\fP & from)\fC [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 data from the socket. Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 337 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KSocketDevice::peekBlock(), KNetwork::KActiveSocketBase::resetError(), and KNetwork::KSocketBase::socketDevice().
.SS "Q_LONG KClientSocketBase::writeBlock (const char * data, Q_ULONG len)\fC [virtual]\fP"
.PP
Writes data to the socket. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 349 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KActiveSocketBase::resetError(), KNetwork::KSocketBase::socketDevice(), and KNetwork::KSocketDevice::writeBlock().
.PP
Referenced by KNetwork::KDatagramSocket::send().
.SS "Q_LONG KClientSocketBase::writeBlock (const char * data, Q_ULONG len, const \fBKSocketAddress\fP & to)\fC [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 data to the socket. Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 361 of file kclientsocketbase.cpp.
.PP
References copyError(), KNetwork::KSocketBase::error(), gotError(), KNetwork::KActiveSocketBase::resetError(), KNetwork::KSocketBase::socketDevice(), and KNetwork::KSocketDevice::writeBlock().
.SS "\fBKSocketAddress\fP KClientSocketBase::localAddress () const\fC [virtual]\fP"
.PP
Returns the local socket address. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Definition at line 373 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketDevice::localAddress(), and KNetwork::KSocketBase::socketDevice().
.SS "\fBKSocketAddress\fP KClientSocketBase::peerAddress () const\fC [virtual]\fP"
.PP
Returns the peer socket address. 
.PP
Reimplemented from \fBKSocketBase\fP. 
.PP
Implements \fBKNetwork::KActiveSocketBase\fP.
.PP
Definition at line 378 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketDevice::peerAddress(), and KNetwork::KSocketBase::socketDevice().
.PP
Referenced by KNetwork::KBufferedSocket::peekBlock(), and KNetwork::KBufferedSocket::readBlock().
.SS "bool KClientSocketBase::emitsReadyRead () const"
.PP
Returns true if the readyRead signal is set to be emitted. 
.PP
Definition at line 383 of file kclientsocketbase.cpp.
.PP
Referenced by KNetwork::KBufferedSocket::slotReadActivity(), and KNetwork::KBufferedSocket::stateChanging().
.SS "void KClientSocketBase::enableRead (bool enable)\fC [virtual]\fP"
.PP
Enables the emission of the readyRead signal. 
.PP
By default, this signal is enabled.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP whether to enable the signal 
.RE
.PP

.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 388 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketBase::mutex(), KNetwork::KSocketDevice::readNotifier(), QSocketNotifier::setEnabled(), and KNetwork::KSocketBase::socketDevice().
.SS "bool KClientSocketBase::emitsReadyWrite () const"
.PP
Returns true if the readyWrite signal is set to be emitted. 
.PP
Definition at line 398 of file kclientsocketbase.cpp.
.PP
Referenced by KNetwork::KBufferedSocket::stateChanging().
.SS "void KClientSocketBase::enableWrite (bool enable)\fC [virtual]\fP"
.PP
Enables the emission of the readyWrite signal. 
.PP
By default, this signal is disabled.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP whether to enable the signal 
.RE
.PP

.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 403 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketBase::mutex(), QSocketNotifier::setEnabled(), KNetwork::KSocketBase::socketDevice(), and KNetwork::KSocketDevice::writeNotifier().
.SS "void KClientSocketBase::slotReadActivity ()\fC [protected, virtual, slot]\fP"
.PP
This slot is connected to the read notifier's signal meaning the socket can read more data. 
.PP
The default implementation only emits the readyRead signal.
.PP
Override if your class requires processing of incoming data. 
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 413 of file kclientsocketbase.cpp.
.PP
References readyRead().
.PP
Referenced by stateChanging().
.SS "void KClientSocketBase::slotWriteActivity ()\fC [protected, virtual, slot]\fP"
.PP
This slot is connected to the write notifier's signal meaning the socket can write more data. 
.PP
The default implementation only emits the readyWrite signal.
.PP
Override if your class writes data from another source (like a buffer). 
.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 419 of file kclientsocketbase.cpp.
.PP
References readyWrite().
.PP
Referenced by stateChanging().
.SS "void KNetwork::KClientSocketBase::stateChanged (int newstate)\fC [signal]\fP"
.PP
This signal is emitted whenever the socket state changes. 
.PP
Note: do not delete this object inside the slot called by this signal.
.PP
\fBParameters:\fP
.RS 4
\fInewstate\fP the new state of the socket object 
.RE
.PP

.PP
Referenced by bind(), close(), KNetwork::KBufferedSocket::close(), KNetwork::KDatagramSocket::connect(), connect(), disconnect(), and lookup().
.SS "void KNetwork::KClientSocketBase::gotError (int code)\fC [signal]\fP"
.PP
This signal is emitted when this object finds an error. 
.PP
The \fCcode\fP parameter contains the error code that can also be found by calling \fBerror\fP. 
.PP
Referenced by KNetwork::KStreamSocket::connect(), peekBlock(), KNetwork::KBufferedSocket::peekBlock(), readBlock(), KNetwork::KBufferedSocket::readBlock(), KNetwork::KDatagramSocket::receive(), KNetwork::KBufferedSocket::slotReadActivity(), KNetwork::KBufferedSocket::slotWriteActivity(), waitForMore(), writeBlock(), and KNetwork::KBufferedSocket::writeBlock().
.SS "void KNetwork::KClientSocketBase::hostFound ()\fC [signal]\fP"
.PP
This signal is emitted when the lookup is successfully completed. 
.PP
Referenced by KNetwork::KStreamSocket::connect(), and KNetwork::KDatagramSocket::KDatagramSocket().
.SS "void KNetwork::KClientSocketBase::bound (const \fBKResolverEntry\fP & local)\fC [signal]\fP"
.PP
This signal is emitted when the socket successfully binds to an address. 
.PP
\fBParameters:\fP
.RS 4
\fIlocal\fP the local address we bound to 
.RE
.PP

.PP
Referenced by bind().
.SS "void KNetwork::KClientSocketBase::aboutToConnect (const \fBKResolverEntry\fP & remote, bool & skip)\fC [signal]\fP"
.PP
This signal is emitted when the socket is about to connect to an address (but before doing so). 
.PP
The \fCskip\fP 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 \fCremote\fP).
.PP
This function is also useful if one wants to reset the timeout.
.PP
\fBParameters:\fP
.RS 4
\fIremote\fP the address we're about to connect to 
.br
\fIskip\fP set to true if you want to skip this address 
.RE
.PP
\fBNote:\fP
.RS 4
if the connection is successful, the \fBconnected\fP signal will be emitted. 
.RE
.PP

.SS "void KNetwork::KClientSocketBase::connected (const \fBKResolverEntry\fP & remote)\fC [signal]\fP"
.PP
This socket is emitted when the socket successfully connects to a remote address. 
.PP
\fBParameters:\fP
.RS 4
\fIremote\fP the remote address we did connect to 
.RE
.PP

.PP
Referenced by connect().
.SS "void KNetwork::KClientSocketBase::closed ()\fC [signal]\fP"
.PP
This signal is emitted when the socket completes the closing/shut down process. 
.PP
Referenced by close().
.SS "void KNetwork::KClientSocketBase::readyRead ()\fC [signal]\fP"
.PP
This signal is emitted whenever the socket is ready for reading -- i.e., there is data to be read in the buffers. 
.PP
The subsequent read operation is guaranteed to be non-blocking.
.PP
You can toggle the emission of this signal with the \fBenableRead\fP function. This signal is by default enabled. 
.PP
Referenced by slotReadActivity(), and KNetwork::KBufferedSocket::slotReadActivity().
.SS "void KNetwork::KClientSocketBase::readyWrite ()\fC [signal]\fP"
.PP
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. 
.PP
The subsequent write operation is guaranteed to be non-blocking.
.PP
You can toggle the emission of this signal with the \fBenableWrite\fP 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. 
.PP
Referenced by slotWriteActivity().
.SS "void KClientSocketBase::setState (\fBSocketState\fP state)\fC [protected]\fP"
.PP
Sets the socket state to \fCstate\fP. 
.PP
This function does not emit the \fBstateChanged\fP signal. 
.PP
Definition at line 69 of file kclientsocketbase.cpp.
.PP
References stateChanging().
.PP
Referenced by KNetwork::KServerSocket::accept(), bind(), close(), KNetwork::KBufferedSocket::close(), KNetwork::KDatagramSocket::connect(), connect(), disconnect(), and lookup().
.SS "void KClientSocketBase::stateChanging (\fBSocketState\fP newState)\fC [protected, virtual]\fP"
.PP
This function is called by \fBsetState\fP whenever the state changes. 
.PP
You should override it if you need to specify any actions to be done when the state changes.
.PP
The default implementation acts for these states only:
.IP "\(bu" 2
Connected: it sets up the socket notifiers to fire readyRead and readyWrite signals. 
.PP

.PP
Reimplemented in \fBKNetwork::KBufferedSocket\fP.
.PP
Definition at line 448 of file kclientsocketbase.cpp.
.PP
References QObject::connect(), KNetwork::KSocketDevice::readNotifier(), QSocketNotifier::setEnabled(), slotReadActivity(), slotWriteActivity(), KNetwork::KSocketBase::socketDevice(), and KNetwork::KSocketDevice::writeNotifier().
.PP
Referenced by setState().
.SS "void KClientSocketBase::copyError ()\fC [protected]\fP"
.PP
Convenience function to set this object's error code to match that of the socket device. 
.PP
Definition at line 472 of file kclientsocketbase.cpp.
.PP
References KNetwork::KSocketBase::error(), KNetwork::KActiveSocketBase::setError(), KNetwork::KSocketBase::socketDevice(), and QIODevice::status().
.PP
Referenced by connect(), disconnect(), peekBlock(), readBlock(), setSocketOptions(), KNetwork::KBufferedSocket::slotReadActivity(), KNetwork::KBufferedSocket::slotWriteActivity(), waitForMore(), and writeBlock().

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