X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FReadWritePolicy.hh;h=7d7a537f7446812ed3587058c13fce378ae95dbf;hb=31d85cd6b8e03c5ecc924ca8892906be1bab702f;hp=00ab590dd3e0250ba624ad39cb54e0670b02cae7;hpb=85ab07d100a382467a42e19d741d403a7a96c951;p=senf.git diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index 00ab590..7d7a537 100644 --- a/Socket/ReadWritePolicy.hh +++ b/Socket/ReadWritePolicy.hh @@ -48,7 +48,7 @@ namespace senf { /** \brief ReadPolicy for readable sockets This policy provides support for readable sockets via the standard UNIX read/recvfrom system - cals. The concreate semantics of the read calls depend on the framing policy of the socket. + calls. The concrete semantics of the read calls depend on the framing policy of the socket. */ struct ReadablePolicy : public ReadPolicyBase { @@ -61,7 +61,8 @@ namespace senf { template static unsigned readfrom(ClientSocketHandle handle, char * buffer, unsigned size, typename Policy::AddressingPolicy::Address & address, - typename IfCommunicationPolicyIs::type * = 0); + typename IfCommunicationPolicyIs< + Policy,UnconnectedCommunicationPolicy>::type * = 0); ///< read data from socket returning peer address /**< \param[in] handle socket handle to read from \param[in] buffer address of buffer to write data to @@ -86,13 +87,14 @@ namespace senf { /** \brief WritePolicy for writeable sockets This policy provides support for writable sockets via the standard UNIX write/sendto system - cals. The concreate semantics of the write calls depend on the framing policy of the socket. + calls. The concrete semantics of the write calls depend on the framing policy of the socket. */ struct WriteablePolicy : public WritePolicyBase { template static unsigned write(ClientSocketHandle handle, char const * buffer, unsigned size, - typename IfCommunicationPolicyIs::type * = 0); + typename IfCommunicationPolicyIs< + Policy,ConnectedCommunicationPolicy>::type * = 0); ///< write data to socket /**< This member is only enabled if the socket uses connected communication. Otherwise the communication @@ -105,9 +107,11 @@ namespace senf { \returns number of bytes written */ template static unsigned writeto(ClientSocketHandle handle, - typename boost::call_traits::param_type addr, + typename boost::call_traits< + typename Policy::AddressingPolicy::Address>::param_type addr, char const * buffer, unsigned size, - typename IfCommunicationPolicyIs::type * = 0); + typename IfCommunicationPolicyIs< + Policy,UnconnectedCommunicationPolicy>::type * = 0); ///< write data to socket sending to given peer /**< This member is only enabled if the socket uses unconnected communication. Otherwise no target may be @@ -123,7 +127,7 @@ namespace senf { private: static unsigned do_write(FileHandle handle, char const * buffer, unsigned size); static unsigned do_writeto(FileHandle handle, char const * buffer, unsigned size, - struct sockaddr * addr, socklen_t len); + struct sockaddr const * addr, socklen_t len); }; /** \brief WritePolicy for unwriteable sockets @@ -153,4 +157,5 @@ namespace senf { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" // End: