X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FCommunicationPolicy.hh;h=c589b35cfec346e2096d480c28d7fa6219abc0cb;hb=a4e14250b78fdbc289e29c5d25dd1444aae7dc3e;hp=0da99308a4f5c899328677a2cf045d06f98d817e;hpb=afa15c46e79de0f407d41fda78b6e8d08700caa8;p=senf.git diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index 0da9930..c589b35 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 @@ -42,7 +42,7 @@ namespace senf { /// \addtogroup policy_impl_group /// @{ - template class ServerSocketHandle; + template class ServerSocketHandle; /** \brief CommunicationPolicy for connected sockets @@ -52,26 +52,26 @@ namespace senf { struct ConnectedCommunicationPolicy : public CommunicationPolicyBase { # ifndef DOXYGEN - template - static void listen(ServerSocketHandle handle, unsigned backlog, - typename IfAddressingPolicyIsNot::type * = 0); + template + static void listen(ServerSocketHandle handle, unsigned backlog, + typename IfAddressingPolicyIsNot::type * = 0); # else - template - static void listen(ServerSocketHandle handle, unsigned backlog); + 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); + 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); + 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 @@ -84,6 +84,16 @@ namespace senf { \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); @@ -105,7 +115,7 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// -//#include "CommunicationPolicy.cci" +#include "CommunicationPolicy.cci" //#include "CommunicationPolicy.ct" #include "CommunicationPolicy.cti" #endif