X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FCommunicationPolicy.hh;h=9c0af83e8b8d8508e3528240ae67d3342143eff4;hb=bf0359f0d094233072c9640abeb72464a0719305;hp=11c9af117584ddf0108dddae5d3b9a6302eab654;hpb=85ab07d100a382467a42e19d741d403a7a96c951;p=senf.git diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index 11c9af1..9c0af83 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -51,14 +51,12 @@ namespace senf { */ struct ConnectedCommunicationPolicy : public CommunicationPolicyBase { - static void listen(FileHandle handle, unsigned backlog); + template + static void listen(ServerSocketHandle handle, unsigned backlog, + typename IfAddressingPolicyIsNot::type * = 0); ///< Enable establishing new connections on the socket /**< \param[in] handle socket handle to enable reception on - \param[in] backlog size of backlog queue - - \fixme listen probably makes no sense without accpept, - so listen() should debend on AddressingPolicy - too. */ + \param[in] backlog size of backlog queue */ template static int accept(ServerSocketHandle handle, typename ServerSocketHandle::Address & address, @@ -74,6 +72,7 @@ namespace senf { peer \returns file descriptor of new client socket */ private: + static void do_listen(FileHandle handle, unsigned backlog); static int do_accept(FileHandle handle, struct sockaddr * addr, unsigned len); }; @@ -82,7 +81,7 @@ namespace senf { This is different from UndefinedCommunicationPolicy (which is the same as CommunicationPolicyBase). This policy class defines the communication policy -- it explicitly states, that the socket does not support connected communication. This - effektively disables ther ServerSocketHandle. + effectively disables the ServerSocketHandle. */ struct UnconnectedCommunicationPolicy : public CommunicationPolicyBase {};