changeset 507:b2b2442e3291

Sockets: fix epoll, get rid of State enumeration
author David Demelier <markand@malikania.fr>
date Mon, 22 Feb 2016 20:19:54 +0100
parents 627284574e42
children 8fc7fe1ec915
files modules/sockets/sockets.h
diffstat 1 files changed, 3 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- 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;