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