diff C++/SocketListener.h @ 278:adcae2bde2f0

Socket: listener now have initializer list constructor
author David Demelier <markand@malikania.fr>
date Thu, 23 Oct 2014 18:15:38 +0200
parents b544a599e08e
children 836903141476 24085fae3162
line wrap: on
line diff
--- a/C++/SocketListener.h	Thu Oct 23 17:59:14 2014 +0200
+++ b/C++/SocketListener.h	Thu Oct 23 18:15:38 2014 +0200
@@ -21,6 +21,8 @@
 
 #include <chrono>
 #include <functional>
+#include <initializer_list>
+#include <utility>
 #include <vector>
 
 #include "Socket.h"
@@ -175,7 +177,15 @@
 	 *
 	 * @param method the preferred method
 	 */
-	SocketListener(int method = Poll);
+	SocketListener(int method = PreferredMethod);
+
+	/**
+	 * Createa listener with some sockets.
+	 *
+	 * @param list the initializer list
+	 * @param method the preferred method
+	 */
+	SocketListener(std::initializer_list<std::pair<Socket, int>> list, int method = PreferredMethod);
 
 	/**
 	 * Add a socket to listen to.