X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FBSDSocketProtocol.hh;h=715837f4a26b72d80ec42bcb6812c0725b1ef4a8;hb=3863d46dd898b7bc35ea8c6ccd8563b18762a6b6;hp=616557c3b9d9f7890a0f9927553e2184da7174cc;hpb=716fd03abb79cbf8ab6618bbea50aacaa24003c5;p=senf.git diff --git a/Socket/Protocols/BSDSocketProtocol.hh b/Socket/Protocols/BSDSocketProtocol.hh index 616557c..715837f 100644 --- a/Socket/Protocols/BSDSocketProtocol.hh +++ b/Socket/Protocols/BSDSocketProtocol.hh @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -23,8 +23,8 @@ /** \file \brief BSDSocketProtocol public header */ -#ifndef HH_BSDSocketProtocol_ -#define HH_BSDSocketProtocol_ 1 +#ifndef HH_SENF_Socket_Protocols_BSDSocketProtocol_ +#define HH_SENF_Socket_Protocols_BSDSocketProtocol_ 1 // Custom includes #include "../../Socket/SocketProtocol.hh" @@ -59,27 +59,7 @@ namespace senf { forever. \param[in] enable \c true to activate linger \param[in] timeout linger timeout in seconds */ - - }; - - /** \brief Protocol facet providing basic connection oriented BSD socket functions - - AddressableBSDSocketProtocol provides the BSD socket API as it generically applies to - addressable (connection oriented) sockets. - */ - class AddressableBSDSocketProtocol - : public virtual SocketProtocol - { - public: - bool reuseaddr() const; ///< Return current reuseaddr state - /**< \returns \c true if \c SO_REUSEADDR is currently - enabled, \c false otherwise*/ - void reuseaddr(bool value) const; ///< Set reuseraddr state - /**< A \c true value enables \c SO_REUSEADDR, \c false will - disable it. - \param[in] value new \c SO_REUSEADDR state */ - - boost::uint8_t priority() const; ///< Get packet priority assigned to outgoing packets + boost::uint8_t priority() const; ///< Get packet priority assigned to outgoing packets /**< This call will return the priority value assigned to packets sent via this socket. Depending on the protocol, this value may also be placed inside the @@ -91,6 +71,11 @@ namespace senf { sets the TOS field. \param[in] value new socket priority */ + int error() const; ///< Get and clear pending socket error + /**< This call will get and clear a pending socket + error. This includes asynchronous errors received via + the network (e.g. via ICMP). */ + unsigned rcvbuf() const; ///< Check receive buffer size /**< \returns size of receive buffer in bytes \internal Linux doubles the buffer size internally when @@ -109,6 +94,24 @@ namespace senf { void sndbuf(unsigned size) const; ///< Change size of send buffer /**< \param[in] size new send buffer size */ + }; + + /** \brief Protocol facet providing basic connection oriented BSD socket functions + + AddressableBSDSocketProtocol provides the BSD socket API as it generically applies to + addressable (connection oriented) sockets. + */ + class AddressableBSDSocketProtocol + : public virtual SocketProtocol + { + public: + bool reuseaddr() const; ///< Return current reuseaddr state + /**< \returns \c true if \c SO_REUSEADDR is currently + enabled, \c false otherwise*/ + void reuseaddr(bool value) const; ///< Set reuseraddr state + /**< A \c true value enables \c SO_REUSEADDR, \c false will + disable it. + \param[in] value new \c SO_REUSEADDR state */ }; /// @}