2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum NETwork research (NET)
4 // David Wagner <david.wagner@fokus.fraunhofer.de>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 \brief UNProtocol public header */
24 #ifndef HH_UNProtocol_
25 #define HH_UNProtocol_ 1
28 #include "../../../Socket/SocketProtocol.hh"
29 #include "UNAddressing.hh"
30 #include "../../../Socket/ClientSocketHandle.hh"
31 #include "../../../Socket/CommunicationPolicy.hh"
33 //#include "UNProtocol.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
38 /// \addtogroup protocol_facets_group
41 /** \brief Protocol facet providing Unix Domain Addressing related API
43 This protocol facet introduces all the socket api protocol members which are related to Unix
46 \todo connect() is only available on stream sockets. We want to access bind() and connect()
47 via the ClientSocketHandle -> see SocketProtocol todo point
50 : public virtual SocketProtocol
53 void connect(UNSocketAddress const & address) const; ///< Connect to a unix domain socket
54 /**< \todo make this obsolete by allowing access to the
55 ClientSocketHandle from ConcreateSocketProtocol
56 \param[in] address Address to connect to */
57 void bind(UNSocketAddress const & address) const; ///< Set local socket address (path)
58 /**< \todo make this obsolete by allowing access to the
59 ClientSocketHandle from ConcreateSocketProtocol
60 \param[in] address Address to set */
62 virtual void close() const; ///< Close socket
63 /**< This override will automatically \c shutdown() the
64 socket whenever it is closed.
65 \throws senf::SystemException */
66 virtual void terminate() const; ///< Forcibly close socket
67 /**< This override will automatically \c shutdown() the
68 socket whenever it is called. Additionally it will
69 disable SO_LINGER to ensure, that v_terminate will not
70 block. Like the overriden method, this member will ignore
71 failures and will never throw. It therefore safe to be
72 called from a destructor. */ ///\name Abstract Interface Implementation
75 unsigned available() const;
79 void check_and_unlink() const;
85 ///////////////////////////////hh.e////////////////////////////////////////
86 //#include "UNProtocol.cci"
87 //#include "UNProtocol.ct"
88 //#include "UNProtocol.cti"
96 // c-file-style: "senf"
97 // indent-tabs-mode: nil
98 // ispell-local-dictionary: "american"
99 // compile-command: "scons -u test"