//#include "UNAddress.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
+ /** \brief Unix domain address
+
+ UNAddress represents a simple unix domain address which is given by a path to a socket.
+ It is modelled as a boost::filesystem::path.
+
+ \ingroup addr_group
+ */
class UNAddress
: public boost::filesystem::path,
public ComparableSafeBool<UNAddress>
{
public:
- UNAddress();
- explicit UNAddress(boost::filesystem::path);
- static UNAddress fromString(std::string & s);
- static UNAddress fromPath(boost::filesystem::path & p);
- static std::string pathString();
- struct AddressException : public std::exception {};
+ UNAddress(); ///< Construct an empty address
+ explicit UNAddress(boost::filesystem::path);///< Construct an address constant from given path
+ static UNAddress fromString(std::string & s); ///< Convert string to address by interpreting the string as path
+ static UNAddress fromPath(boost::filesystem::path & p);///< Convert path to address
+ static std::string pathString(); ///< Return the path of the address as string
+
+ /** \brief Base-class for UNAddress exceptions */
+ struct AddressException : public std::exception {};
+
private:
static boost::filesystem::path path;
};
//#include "UNAddressing.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
+ /** \brief Unix domain socket address
+
+ UNSocketAddress wraps the standard sockaddr_in datatype. It provides simple accessor methods
+ to access the path.
+
+ \implementation This implementation is based on sockaddr_un.
+
+ \ingroup addr_group
+ */
class UNSocketAddress
: public ComparableSafeBool<UNSocketAddress>
{
public:
- //UNSocketAddress();
+ //UNSocketAddress();
explicit UNSocketAddress(boost::filesystem::path p);
- ///< Construct an address constant
- static UNSocketAddress from_string(std::string const s);
- static UNSocketAddress from_path(boost::filesystem::path const p);
- static std::string path();
+ ///< Construct an address constant from given path
+ static UNSocketAddress from_string(std::string const s); ///< Create UNSocketAddress from string
+ static UNSocketAddress from_path(boost::filesystem::path const p); ///< Create UNSocketAddress from path
+ static std::string path(); ///< Return path as string
static sockaddr_un sockaddr();
+
struct sockaddr * sockaddr_p();
struct sockaddr const * sockaddr_p() const;
unsigned sockaddr_len() const;
private:
static struct sockaddr_un sockAddr;
};
+
+ /** \brief Write path os
+
+ \related UNSocketAddress
+ */
std::ostream & operator<<(std::ostream & os, UNSocketAddress const & addr);
+ /// \addtogroup policy_impl_group
+ /// @{
+
+ /** \brief Addressing policy supporting unix domain addressing
+
+ \par Address Type:
+ UNAddress
+
+ This addressing policy implements addressing using unix domain
+ addresses.
+
+ The various members are directly imported from
+ GenericAddressingPolicy which see for a detailed
+ documentation.
+ */
struct UNAddressingPolicy
: public AddressingPolicyBase,
ReadablePolicy,
WriteablePolicy,
SocketBufferingPolicy
- >::policy UNDatagramSocket_Policy;
+ >::policy UNDatagramSocket_Policy; ///< Socket Policy of the Unix Domain Datagram Protocol
+ /** \brief Unix Domain Datagram Socket Protocol
+
+ \par Socket Handle typedefs:
+ \ref UNDatagramSocketHandle (ProtocolClientSocketHandle)
+
+ \par Policy Interface: (to be checked)
+ ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
+ ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local(),
+ ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
+
+ \par Address Type:
+ UNAddress
+
+ UNDatagramSocketProtocol provides an datagram protocol socket based on the unix domain addressing.
+
+ This class is utilized as the protocol class of the ProtocolClientSocketHandle
+ via the Socket Handle typedefs above.
+
+ */
class UNDatagramSocketProtocol
: public ConcreteSocketProtocol<UNDatagramSocket_Policy>,
public UNProtocol,
: public virtual SocketProtocol
{
public:
- void connect(UNSocketAddress const & address) const; ///< Connect to remote address
+ void connect(UNSocketAddress const & address) const; ///< Connect to a unix domain socket
/**< \todo make this obsolete by allowing access to the
ClientSocketHandle from ConcreateSocketProtocol
\param[in] address Address to connect to */
- void bind(UNSocketAddress const & address) const; ///< Set local socket address
+ void bind(UNSocketAddress const & address) const; ///< Set local socket address (path)
/**< \todo make this obsolete by allowing access to the
ClientSocketHandle from ConcreateSocketProtocol
\param[in] address Address to set */