From 574dc64dfe1e2c8b52348f95619a845172282238 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 5 Oct 2016 13:39:11 +0200 Subject: Move getSockets() to SocketServer interface Any caller using add or remove should also be able to list the sockets. --- common/network/Socket.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/network') diff --git a/common/network/Socket.h b/common/network/Socket.h index 13b12d1d..53f957e6 100644 --- a/common/network/Socket.h +++ b/common/network/Socket.h @@ -21,6 +21,8 @@ #ifndef __NETWORK_SOCKET_H__ #define __NETWORK_SOCKET_H__ +#include + #include #include #include @@ -125,6 +127,10 @@ namespace network { // resources to be freed. virtual void removeSocket(network::Socket* sock) = 0; + // getSockets() gets a list of sockets. This can be used to generate an + // fd_set for calling select(). + virtual void getSockets(std::list* sockets) = 0; + // processSocketReadEvent() tells the server there is a Socket read event. // The implementation can indicate that the Socket is no longer active // by calling shutdown() on it. The caller will then call removeSocket() -- cgit v1.2.3