18 #ifndef HH_SENF_Socket_ServerSocketHandle_ 19 #define HH_SENF_Socket_ServerSocketHandle_ 1 22 #include <boost/call_traits.hpp> 33 template <
class SPolicy>
class ClientSocketHandle;
63 template <
class SPolicy>
64 class ServerSocketHandle
65 :
public SocketHandle<SPolicy>
72 typedef typename SPolicy::AddressingPolicy::Address
Address;
79 typedef typename boost::call_traits<Address>::param_type
AddressParam;
96 template <
class OtherPolicy>
100 template <
class OtherPolicy>
120 void bind (AddressParam addr);
134 void listen (
unsigned backlog=0);
147 void local (Address & addr);
163 std::pair<ClientHandle, Address>
184 void state(SocketStateMap & map,
unsigned lod=0);
std::string dumpState(unsigned lod=0)
static ServerSocketHandle cast_static(FileHandle handle)
std::pair< ClientHandle, Address > acceptfrom()
Accept new connection.
SPolicy::AddressingPolicy::Address Address
Address type from the addressing policy.
SocketHandle< SPolicy >::template IsCompatible< OtherPolicy >::type const & operator=(ServerSocketHandle< OtherPolicy > other)
Generic SocketHandle with client interface.
Generic SocketHandle with server interface.
void listen(unsigned backlog=0)
Allow clients to connect to this server socket.
Basic file handle wrapper.
void bind(AddressParam addr)
Set local address.
ClientHandle accept()
Accept new connection.
ClientSocketHandle< SPolicy > ClientHandle
Corresponding client socket handle with the same policy.
basic SocketHandle supporting protocol and policy abstraction
Address local()
Query local address.
SocketBody & body()
Access socket body.
boost::call_traits< Address >::param_type AddressParam
'Best' type for passing address as parameter
static ServerSocketHandle cast_dynamic(FileHandle handle)
SocketHandle public header.
Check policy compatibility.
void state(SocketStateMap &map, unsigned lod=0)