#include <senf/Socket/ProtocolServerSocketHandle.hh>
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).
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) |
typedef SocketProtocol senf::ProtocolServerSocketHandle< SocketProtocol >:: | ||||
Protocol | ||||
The socket protocol.
Definition at line 73 of file ProtocolServerSocketHandle.hh.
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.
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.
body
allocated.Definition at line 40 of file ProtocolServerSocketHandle.cti.
senf::ProtocolServerSocketHandle< SocketProtocol >:: | ||||
ProtocolServerSocketHandle | ( | FileHandle | other, | |
bool | isChecked | ) | ||
Definition at line 114 of file ProtocolServerSocketHandle.cti.
senf::ProtocolClientSocketHandle< SocketProtocol > senf::ProtocolServerSocketHandle< SocketProtocol >:: | ||||
accept | () | |||
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()
senf::SystemException | This variant ... |
Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.
Definition at line 66 of file ProtocolServerSocketHandle.cti.
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.
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.
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.
lod | level of detail requested. The interpretation of this value is protocol specific |
Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.
Definition at line 105 of file ProtocolServerSocketHandle.cti.
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.
Definition at line 55 of file ProtocolServerSocketHandle.cti.
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.
map | string to string mapping to be filled with state information | |
lod | level of detail requested. The interpretation of this value is protocol specific |
Reimplemented from senf::ServerSocketHandle< SocketProtocol::Policy >.
Definition at line 92 of file ProtocolServerSocketHandle.cti.