X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FCommunicationPolicy.hh;h=47dc01f57943efd0c259d0681a7292002910baf7;hb=3863d46dd898b7bc35ea8c6ccd8563b18762a6b6;hp=f82ed805eaa991369e61fe225d65dc2c50fac71d;hpb=31d85cd6b8e03c5ecc924ca8892906be1bab702f;p=senf.git diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index f82ed80..47dc01f 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -24,8 +24,8 @@ \brief CommunicationPolicy public header */ -#ifndef HH_CommunicationPolicy_ -#define HH_CommunicationPolicy_ 1 +#ifndef HH_SENF_Socket_CommunicationPolicy_ +#define HH_SENF_Socket_CommunicationPolicy_ 1 // Custom includes #include "SocketPolicy.hh" @@ -42,7 +42,7 @@ namespace senf { /// \addtogroup policy_impl_group /// @{ - template class ServerSocketHandle; + template class ServerSocketHandle; /** \brief CommunicationPolicy for connected sockets @@ -51,16 +51,27 @@ namespace senf { */ struct ConnectedCommunicationPolicy : public CommunicationPolicyBase { - template - static void listen(ServerSocketHandle handle, unsigned backlog, - typename IfAddressingPolicyIsNot::type * = 0); +# 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 */ - template - static int accept(ServerSocketHandle handle, - typename ServerSocketHandle::Address & address, - typename IfAddressingPolicyIsNot::type * = 0); +# 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 @@ -105,4 +128,5 @@ namespace senf { // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" +// comment-column: 40 // End: