X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FCommunicationPolicy.hh;h=2f2911e39569a435ea889afd5462debb93660121;hb=821f1bf89a0e3ef83469c56e4a9a21c39b956cb4;hp=1f8bb032754b75444008c5fc64999ec21941ec3f;hpb=145f6a7d0f3a6aaa77b3625351c952d24cb0b8a1;p=senf.git diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index 1f8bb03..2f2911e 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -51,16 +51,27 @@ namespace senf { */ struct ConnectedCommunicationPolicy : public CommunicationPolicyBase { +# ifndef DOXYGEN template static void listen(ServerSocketHandle handle, unsigned backlog, typename IfAddressingPolicyIsNot::type * = 0); +# else + template + static void listen(ServerSocketHandle handle, unsigned backlog); ///< Enable establishing new connections on the socket /**< \param[in] handle socket handle to enable reception on \param[in] backlog size of backlog queue */ +# endif + +# ifndef DOXYGEN template static int accept(ServerSocketHandle handle, typename ServerSocketHandle::Address & address, typename IfAddressingPolicyIsNot::type * = 0); +# else + template + static int accept(ServerSocketHandle handle, + typename ServerSocketHandle::Address & address); ///< accept a new connection on the socket. /**< The accept() member will return a new client file descriptor. This file descriptor will be used by the @@ -71,6 +82,18 @@ namespace senf { \param[out] address address of newly connected remote peer \returns file descriptor of new client socket */ +# endif + + static int accept(FileHandle handle); + ///< accept a new connection on the socket. + /**< The accept() member will return a new client file + descriptor. This file descriptor will be used by the + ServerSocketHandle implementation to build a new + ClientSocketHandle for the new connection. + + \param[in] handle socket handle to accept connection on + \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); @@ -92,7 +115,7 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// -//#include "CommunicationPolicy.cci" +#include "CommunicationPolicy.cci" //#include "CommunicationPolicy.ct" #include "CommunicationPolicy.cti" #endif