senf::ProtocolServerSocketHandle< SocketProtocol > Class Template Reference
[The Handle Hierarchy]

Protocol specific socket handle (server interface). More...

#include <senf/Socket/ProtocolServerSocketHandle.hh>

Inheritance diagram for senf::ProtocolServerSocketHandle< SocketProtocol >:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class SocketProtocol>
class senf::ProtocolServerSocketHandle< SocketProtocol >

Protocol specific socket handle (server interface).

The ProtocolServerSocketHandle is the server interface leaf class of the handle hierarchy. This is the class to instantiate to open a new socket. This is also the only class, which can be used to open a server socket.

The Protocol template argument defines the protocol of the socket. This protocol provides the protocol interface of the socket as well as the complete socket policy of this protocol.

The ProtocolServerSocketHandle adds the protocol interface as an additional interface to the socket handle. This interface is only accessible via the protocol class. All socket functionality not available through the policy interface (see ServerSocketHandle) is accessible via the protocol() member.

A ProtocolServerSocketHandle is only meaningful for connection oriented addressable protocols (CommunicationPolicy is ConnectedCommunicationPolicy and AddressingPolicy is not NoAddressingPolicy).

See also:
The Protocol Classes

Definition at line 66 of file ProtocolServerSocketHandle.hh.


Public Types

typedef SocketProtocol  Protocol
  The socket protocol.

Public Member Functions

Protocol protocol ()
  Access the protocol interface.
ProtocolClientSocketHandle
< SocketProtocol
accept ()
  Accept new connection.
void  state (SocketStateMap &map, unsigned lod=0)
  Inquire state information of socket handle.
std::string  dumpState (unsigned lod=0)
  Format complete state information as string.

Static Public Member Functions

static ProtocolServerSocketHandle  cast_static (FileHandle handle)
static ProtocolServerSocketHandle  cast_dynamic (FileHandle handle)

Structors and default members

  ProtocolServerSocketHandle ()
  Create new server socket.
  ProtocolServerSocketHandle (senf::NoInit_t)
  Create uninitialized socket variable.

Protected Member Functions

  ProtocolServerSocketHandle (FileHandle other, bool isChecked)

Member Typedef Documentation

template<class SocketProtocol >
typedef SocketProtocol senf::ProtocolServerSocketHandle< SocketProtocol >::
Protocol

The socket protocol.

Definition at line 73 of file ProtocolServerSocketHandle.hh.


Constructor & Destructor Documentation

template<class SocketProtocol >
senf::ProtocolServerSocketHandle< SocketProtocol >::
ProtocolServerSocketHandle ()

Create new server socket.

This constructor is one of the possible constructors. The exact Signature of the constructor (or constructors) is defined by the init_server() member (or members) of the Protocol class. ProtocolClientSocketHandle defines a number of constructors taking up to 9 arguments which just forward to a corresponding Protocolinit_server() member. See the documentation of the respective Protocol class for a detailed documentation of that protocols constructors.

Definition at line 44 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolServerSocketHandle< SocketProtocol >::
ProtocolServerSocketHandle ( senf::NoInit_t  )

Create uninitialized socket variable.

This special constructor is called when passing ProtocolServerSocketHandle::Uninitialized as only argument to the constructor. This will create an in-valid() socket handle which can however be assigned later with another socket instance.

Implementation note:
The socket handle will have no body allocated.

Definition at line 40 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolServerSocketHandle< SocketProtocol >::
ProtocolServerSocketHandle ( FileHandle  other,
bool  isChecked )

Definition at line 114 of file ProtocolServerSocketHandle.cti.


Member Function Documentation

Accept new connection.

If the handle is non-blocking, accept will NOT block. If no connection is available to be returned, accept will return a ClientSocketHandle which is not valid()

Exceptions:
senf::SystemException  This variant ...
Returns:
handle of new client connection

Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.

Definition at line 66 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolServerSocketHandle< SocketProtocol > senf::ProtocolServerSocketHandle< SocketProtocol >::
cast_dynamic ( FileHandle  handle )

For internal use only.

Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.

Definition at line 81 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolServerSocketHandle< SocketProtocol > senf::ProtocolServerSocketHandle< SocketProtocol >::
cast_static ( FileHandle  handle )

For internal use only.

Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.

Definition at line 74 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
std::string senf::ProtocolServerSocketHandle< SocketProtocol >::
dumpState ( unsigned  lod = 0 )

Format complete state information as string.

Formats the complete state map value and returns it as a single multi-line string.

Parameters:
lod  level of detail requested. The interpretation of this value is protocol specific
Implementation note:
This member will be re-implemented in every derived class. See the state() documentation.

Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.

Definition at line 105 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
SocketProtocol & senf::ProtocolServerSocketHandle< SocketProtocol >::
protocol ()

Access the protocol interface.

The returned protocol class reference gives access to the complete protocol interface as defined by that class. See the respective protocol class documentation.

Returns:
Protocol class reference

Definition at line 55 of file ProtocolServerSocketHandle.cti.

template<class SocketProtocol >
void senf::ProtocolServerSocketHandle< SocketProtocol >::
state ( SocketStateMap map,
unsigned  lod = 0 )

Inquire state information of socket handle.

The map argument (a string to string mapping) will be filled with information covering the current state of the socket. The information provided depends on the socket protocol. The amount of information returned can be controlled using the lod value.

See senf::SocketProtocol::state() for more information, how the Information is generated.

Parameters:
map  string to string mapping to be filled with state information
lod  level of detail requested. The interpretation of this value is protocol specific
Implementation note:
This member will be re-implemented in every derived class. This is very important since state() is not a virtual function (which we don't want since we don't want to add a vtable pointer to every handle instance).

Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.

Definition at line 92 of file ProtocolServerSocketHandle.cti.


The documentation for this class was generated from the following files: