X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FTCPSocketHandle.hh;h=484e6222f4f0c029580292517a06c0140155f1a3;hb=a4911c1fd3f53dc2a7bda6c1d2b00bdc4b864cff;hp=b8354ca41826aaf8ce0b75feb4dc016ac5df9bba;hpb=032707d24b1059febe83ce56b11fd79df106c6e2;p=senf.git diff --git a/Socket/TCPSocketHandle.hh b/Socket/TCPSocketHandle.hh index b8354ca..484e622 100644 --- a/Socket/TCPSocketHandle.hh +++ b/Socket/TCPSocketHandle.hh @@ -21,6 +21,7 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file + \brief TCPv4SocketHandle and TCPv6SocketHandle public header \todo Implement possibly non-blocking connect and SO_ERROR in the protocol interface @@ -45,6 +46,8 @@ namespace senf { + /// \addtogroup concrete_protocol_group + /// @{ typedef MakeSocketPolicy< INet4AddressingPolicy, @@ -53,8 +56,30 @@ namespace senf { ReadablePolicy, WriteablePolicy, SocketBufferingPolicy - >::policy TCPv4Socket_Policy; - + >::policy TCPv4Socket_Policy; ///< Socket Policy of the TCPv4 Protocol + + /** \brief IPv4 TCP Socket Protocol + + \par Socket Handle typedefs: + \ref TCPv4ClientSocketHandle (ProtocolClientSocketHandle), \ref TCPv4ServerSocketHandle + (ProtocolServerSocketHandle) + + \par Protocol Interface: + ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(), + ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(), + ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf() + + \par Address Type: + INet4Address + + TCPv4SocketProtocol provides an internet protocol stream socket based on the TCP protocol + and IPv4 addressing. + + This class is utilized as the protocol class of the ProtocolClientSocketHandle and + ProtocolServerSocketHandle via the Socket Handle typedefs above. + + \see TCPv6SocketProtocol + */ class TCPv4SocketProtocol : public ConcreteSocketProtocol, public IPv4Protocol, @@ -66,12 +91,44 @@ namespace senf { /////////////////////////////////////////////////////////////////////////// // internal interface - void init_client() const; + ///\name Constructors + ///@{ + + void init_client() const; ///< Create unconnected client socket + /**< \note This member is implicitly called from the + ProtocolClientSocketHandle::ProtocolClientSocketHandle() + constructor */ void init_client(INet4Address const & address) const; - void init_server() const; + ///< Create client socket and connect + /**< Creates a new client socket and connects to the given + address. + + \param[in] address remote address to connect to */ + /**< \note This member is implicitly called from the + ProtocolClientSocketHandle::ProtocolClientSocketHandle() + constructor */ + void init_server() const; ///< Create server socket + /**< \note This member is implicitly called from the + ProtocolServerSocketHandle::ProtocolServerSocketHandle() + constructor */ void init_server(INet4Address const & address, unsigned backlog=1) const; + ///< Create server socket and listen + /**< Creates a new server socket, binds to \a address end + starts listening for new connections with a backlog of + \a backlog connections. It also enables reuseaddr(). + + \param[in] address address to listen on + \param[in] backlog size of the listen backlog */ + /**< \note This member is implicitly called from the + ProtocolServerSocketHandle::ProtocolServerSocketHandle() + constructor */ + + ///@} + ///\name Abstract Interface Implementation std::auto_ptr clone() const; + + ///@} }; typedef ProtocolClientSocketHandle TCPv4ClientSocketHandle; @@ -82,6 +139,30 @@ namespace senf { INet6AddressingPolicy >::policy TCPv6Socket_Policy; + /** \brief IPv6 TCP Socket Protocol + + \par Socket Handle typedefs: + \ref TCPv6ClientSocketHandle (ProtocolClientSocketHandle), \ref TCPv6ServerSocketHandle + (ProtocolServerSocketHandle) + + \par Protocol Interface: + ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(), + ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(), + ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf() + + \par Address Type: + INet6Address + + TCPv6SocketProtocol provides an internet protocol stream socket based on the TCP protocol + and IPv6 addressing. + + This class is utilized as the protocol class of the ProtocolClientSocketHandle and + ProtocolServerSocketHandle via the Socket Handle typedefs above. + + \see TCPv4SocketProtocol + + \todo Implement + */ class TCPv6SocketProtocol : public ConcreteSocketProtocol, public IPv6Protocol, @@ -89,12 +170,13 @@ namespace senf { public BSDSocketProtocol, public AddressableBSDSocketProtocol { - /** \todo Implement */ }; typedef ProtocolClientSocketHandle TCPv6ClientSocketHandle; typedef ProtocolServerSocketHandle TCPv6ServerSocketHandle; + /// @} + } ///////////////////////////////hh.e//////////////////////////////////////// @@ -107,4 +189,5 @@ namespace senf { // Local Variables: // mode: c++ // c-file-style: "senf" +// fill-column: 100 // End: