# HG changeset patch # User David Demelier # Date 1456168794 -3600 # Node ID b2b2442e32915dc7f407ee871d9259fa1bc49645 # Parent 627284574e426b1d5e520750a287a1ceb64fa194 Sockets: fix epoll, get rid of State enumeration diff -r 627284574e42 -r b2b2442e3291 modules/sockets/sockets.h --- a/modules/sockets/sockets.h Mon Feb 22 16:09:51 2016 +0100 +++ b/modules/sockets/sockets.h Mon Feb 22 20:19:54 2016 +0100 @@ -432,31 +432,6 @@ /* }}} */ /* - * State class - * ------------------------------------------------------------------ - * - * To facilitate higher-level stuff, the socket has a state. - */ - -/* {{{ State */ - -/** - * @enum State - * @brief Current socket state. - */ -enum class State { - Open, //!< Socket is open - Bound, //!< Socket is bound to an address - Connecting, //!< The connection is in progress - Connected, //!< Connection is complete - Accepted, //!< Socket has been accepted (client) - Closed, //!< The socket has been closed - Disconnected, //!< The connection was lost -}; - -/* }}} */ - -/* * Condition enum * ------------------------------------------------------------------ * @@ -642,14 +617,7 @@ { } - /** - * Construct a socket with an already created descriptor. - * - * @param handle the native descriptor - * @param state specify the socket state - * @param protocol the type of socket implementation - */ - explicit inline Socket(Handle handle, State state = State::Closed, Protocol protocol = {}) noexcept + explicit inline Socket(Handle handle, Protocol protocol = {}) noexcept : m_proto(std::move(protocol)) , m_handle(handle) { @@ -2564,13 +2532,13 @@ */ Epoll(); - inline Epoll(const Epoll &&other) noexcept + inline Epoll(Epoll &&other) noexcept : m_handle(other.m_handle) { other.m_handle = -1; } - Epoll &operator=(const Epoll &&other) + Epoll &operator=(Epoll &&other) { m_handle = other.m_handle; other.m_handle = -1;