• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • KNetwork
  • KPassiveSocketBase
Public Member Functions | List of all members
KNetwork::KPassiveSocketBase Class Referenceabstract

#include <tdesocketbase.h>

Inheritance diagram for KNetwork::KPassiveSocketBase:
KNetwork::TDESocketBase KNetwork::TDEServerSocket KNetwork::TDESocketDevice KNetwork::KHttpProxySocketDevice KNetwork::KMulticastSocketImpl KNetwork::KSocksSocketDevice

Public Member Functions

 KPassiveSocketBase ()
 
virtual ~KPassiveSocketBase ()
 
virtual bool bind (const KResolverEntry &address)=0
 
virtual bool listen (int backlog)=0
 
virtual void close ()=0
 
virtual KActiveSocketBase * accept ()=0
 
virtual TDESocketAddress localAddress () const =0
 
virtual TDESocketAddress externalAddress () const =0
 
- Public Member Functions inherited from KNetwork::TDESocketBase
 TDESocketBase ()
 
virtual ~TDESocketBase ()
 
virtual bool setBlocking (bool enable)
 
bool blocking () const
 
virtual bool setAddressReuseable (bool enable)
 
bool addressReuseable () const
 
virtual bool setIPv6Only (bool enable)
 
bool isIPv6Only () const
 
virtual bool setBroadcast (bool enable)
 
bool broadcast () const
 
TDESocketDevice * socketDevice () const
 
virtual void setSocketDevice (TDESocketDevice *device)
 
int setRequestedCapabilities (int add, int remove=0)
 
SocketError error () const
 
TQString errorString () const
 
TQMutex * mutex () const
 

Additional Inherited Members

- Public Types inherited from KNetwork::TDESocketBase
enum  SocketOptions {
  Blocking = 0x01 , AddressReuseable = 0x02 , IPv6Only = 0x04 , Keepalive = 0x08 ,
  Broadcast = 0x10
}
 
enum  SocketError {
  NoError = 0 , LookupFailure , AddressInUse , AlreadyCreated ,
  AlreadyBound , AlreadyConnected , NotConnected , NotBound ,
  NotCreated , WouldBlock , ConnectionRefused , ConnectionTimedOut ,
  InProgress , NetFailure , NotSupported , Timeout ,
  UnknownError , RemotelyDisconnected
}
 
- Static Public Member Functions inherited from KNetwork::TDESocketBase
static TQString errorString (SocketError code)
 
static bool isFatalError (int code)
 
- Protected Member Functions inherited from KNetwork::TDESocketBase
virtual bool setSocketOptions (int opts)
 
virtual int socketOptions () const
 
bool hasDevice () const
 
void setError (SocketError error)
 

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 thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 683 of file tdesocketbase.h.

Constructor & Destructor Documentation

◆ KPassiveSocketBase()

KPassiveSocketBase::KPassiveSocketBase ( )

Constructor.

Definition at line 321 of file tdesocketbase.cpp.

◆ ~KPassiveSocketBase()

KPassiveSocketBase::~KPassiveSocketBase ( )
virtual

Destructor.

Definition at line 325 of file tdesocketbase.cpp.

Member Function Documentation

◆ accept()

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

Implemented in KNetwork::TDEServerSocket, KNetwork::KSocksSocketDevice, and KNetwork::TDESocketDevice.

◆ bind()

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
addressthe address to bind to
Returns
true if the binding was successful, false otherwise

Implemented in KNetwork::TDEServerSocket, KNetwork::KSocksSocketDevice, and KNetwork::TDESocketDevice.

◆ close()

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::TDEServerSocket, and KNetwork::TDESocketDevice.

◆ externalAddress()

virtual TDESocketAddress KNetwork::KPassiveSocketBase::externalAddress ( ) const
pure virtual

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

Implemented in KNetwork::KHttpProxySocketDevice, KNetwork::TDEServerSocket, KNetwork::KSocksSocketDevice, and KNetwork::TDESocketDevice.

◆ listen()

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
backlogthe number of accepted connections to hold before starting to refuse
Returns
true if the socket is now in listening mode

Implemented in KNetwork::KSocksSocketDevice, KNetwork::TDEServerSocket, and KNetwork::TDESocketDevice.

◆ localAddress()

virtual TDESocketAddress KNetwork::KPassiveSocketBase::localAddress ( ) const
pure virtual

Returns this socket's local address.

Implemented in KNetwork::TDEServerSocket, KNetwork::KSocksSocketDevice, and KNetwork::TDESocketDevice.


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

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.