[Home]BoostSocket/IoctlOptionConcept

BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List

IoctlOption Concept

An IoctlOption? would wrap the arguments to possible ioctl calls.

eg.

    template <int OptionValue?, typename ValueType?>
    struct ioctl_option
    {
      ioctl_option(const ValueType?& ov)
          : value(ov)
      {}

      BOOST_STATIC_CONSTANT(int, option = OptionValue?);
      ValueType? value;
      static int size() {return sizeof(ValueType?); }
    };

    // non-blocking ioctl
    typedef ioctl_option<FIONBIO, u_long>
      socket_ioctl_non_blocking;

    // user code .....
    socket_base socket;
    socket.ioctl(socket_ioctl_non_blocking(true));

It might be worth considering IoctlOption as a SocketOption, with a different option level.


BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List
Edit text of this page | View other revisions
Last edited December 18, 2004 12:29 pm (diff)
Search:
Disclaimer: This site not officially maintained by Boost Developers