aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2016-10-05 13:39:11 +0200
committerPierre Ossman <ossman@cendio.se>2016-10-05 13:39:11 +0200
commit574dc64dfe1e2c8b52348f95619a845172282238 (patch)
tree2957273b0d4bd04a81b9a69c7a0cb22772c4ab85 /common
parent3fed95eda27dfbeee6535f987f5d14a66f64749b (diff)
downloadtigervnc-574dc64dfe1e2c8b52348f95619a845172282238.tar.gz
tigervnc-574dc64dfe1e2c8b52348f95619a845172282238.zip
Move getSockets() to SocketServer interface
Any caller using add or remove should also be able to list the sockets.
Diffstat (limited to 'common')
-rw-r--r--common/network/Socket.h6
-rw-r--r--common/rfb/HTTPServer.h12
-rw-r--r--common/rfb/VNCServerST.h11
3 files changed, 14 insertions, 15 deletions
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 <list>
+
#include <limits.h>
#include <rdr/FdInStream.h>
#include <rdr/FdOutStream.h>
@@ -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<network::Socket*>* 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()
diff --git a/common/rfb/HTTPServer.h b/common/rfb/HTTPServer.h
index d7ca69ad..04ef4993 100644
--- a/common/rfb/HTTPServer.h
+++ b/common/rfb/HTTPServer.h
@@ -26,8 +26,6 @@
#ifndef __RFB_HTTP_SERVER_H__
#define __RFB_HTTP_SERVER_H__
-#include <list>
-
#include <rdr/MemInStream.h>
#include <rfb/UpdateTracker.h>
#include <rfb/Configuration.h>
@@ -58,6 +56,10 @@ namespace rfb {
// Could clean up socket-specific resources here.
virtual void removeSocket(network::Socket* sock);
+ // getSockets() gets a list of sockets. This can be used to generate an
+ // fd_set for calling select().
+ virtual void getSockets(std::list<network::Socket*>* sockets);
+
// processSocketReadEvent()
// The platform-specific side of the server implementation calls
// this method whenever data arrives on one of the active
@@ -73,12 +75,6 @@ namespace rfb {
virtual int checkTimeouts();
- // getSockets() gets a list of sockets. This can be used to generate an
- // fd_set for calling select().
-
- virtual void getSockets(std::list<network::Socket*>* sockets);
-
-
// -=- File interface
// - getFile is passed the path portion of a URL and returns an
diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h
index bd84c452..0ced12a4 100644
--- a/common/rfb/VNCServerST.h
+++ b/common/rfb/VNCServerST.h
@@ -25,8 +25,6 @@
#include <sys/time.h>
-#include <list>
-
#include <rfb/SDesktop.h>
#include <rfb/VNCServer.h>
#include <rfb/Configuration.h>
@@ -67,6 +65,10 @@ namespace rfb {
// Clean up any resources associated with the Socket
virtual void removeSocket(network::Socket* sock);
+ // getSockets() gets a list of sockets. This can be used to generate an
+ // fd_set for calling select().
+ virtual void getSockets(std::list<network::Socket*>* sockets);
+
// processSocketReadEvent
// Read more RFB data from the Socket. If an error occurs during
// processing then shutdown() is called on the Socket, causing
@@ -111,11 +113,6 @@ namespace rfb {
// any), and logs the specified reason for closure.
void closeClients(const char* reason, network::Socket* sock);
- // getSockets() gets a list of sockets. This can be used to generate an
- // fd_set for calling select().
-
- void getSockets(std::list<network::Socket*>* sockets);
-
// getSConnection() gets the SConnection for a particular Socket. If
// the Socket is not recognised then null is returned.