• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KNetwork::KPassiveSocketBase

KNetwork::KPassiveSocketBase Class Reference

#include <k3socketbase.h>

Inheritance diagram for KNetwork::KPassiveSocketBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

Abstract base class for passive sockets.

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

Author:
Thiago Macieira <thiago@kde.org>

Definition at line 771 of file k3socketbase.h.


Public Member Functions

virtual KActiveSocketBase * accept ()=0
virtual bool bind (const KResolverEntry &address)=0
virtual void close ()=0
virtual KSocketAddress externalAddress () const =0
 KPassiveSocketBase ()
virtual bool listen (int backlog)=0
virtual KSocketAddress localAddress () const =0
virtual ~KPassiveSocketBase ()

Constructor & Destructor Documentation

KPassiveSocketBase::KPassiveSocketBase (  ) 

Constructor.

Definition at line 447 of file k3socketbase.cpp.

KPassiveSocketBase::~KPassiveSocketBase (  )  [virtual]

Destructor.

Definition at line 451 of file k3socketbase.cpp.


Member Function Documentation

virtual KActiveSocketBase* KNetwork::KPassiveSocketBase::accept (  )  [pure virtual]

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 specialized socket classes.

Implemented in KNetwork::KServerSocket, KNetwork::KSocketDevice, and KNetwork::KSocksSocketDevice.

virtual bool KNetwork::KPassiveSocketBase::bind ( const KResolverEntry &  address  )  [pure virtual]

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 address object.

Parameters:
address the address to bind to
Returns:
true if the binding was successful, false otherwise

Implemented in KNetwork::KServerSocket, KNetwork::KSocketDevice, and KNetwork::KSocksSocketDevice.

virtual void KNetwork::KPassiveSocketBase::close (  )  [pure virtual]

Closes this socket.

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

Implemented in KNetwork::KHttpProxySocketDevice, KNetwork::KServerSocket, and KNetwork::KSocketDevice.

virtual KSocketAddress KNetwork::KPassiveSocketBase::externalAddress (  )  const [pure virtual]

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

Implemented in KNetwork::KHttpProxySocketDevice, KNetwork::KServerSocket, KNetwork::KSocketDevice, and KNetwork::KSocksSocketDevice.

virtual bool KNetwork::KPassiveSocketBase::listen ( int  backlog  )  [pure virtual]

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.

Parameters:
backlog the number of accepted connections to hold before starting to refuse
Returns:
true if the socket is now in listening mode

Implemented in KNetwork::KServerSocket, KNetwork::KSocketDevice, and KNetwork::KSocksSocketDevice.

virtual KSocketAddress KNetwork::KPassiveSocketBase::localAddress (  )  const [pure virtual]

Returns this socket's local address.

Implemented in KNetwork::KServerSocket, KNetwork::KSocketDevice, and KNetwork::KSocksSocketDevice.


The documentation for this class was generated from the following files:
  • k3socketbase.h
  • k3socketbase.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal