diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-05-03 14:03:55 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-05-04 15:50:08 +0200 |
commit | e3a2be69c48893ef086110b8d92f1fadd004a997 (patch) | |
tree | 84bb7c421bf8a8d95cc615bf31a0464cd19c4c9d /unix | |
parent | f36078ad3f624400cb4e66aca95bf44d60348958 (diff) | |
download | tigervnc-e3a2be69c48893ef086110b8d92f1fadd004a997.tar.gz tigervnc-e3a2be69c48893ef086110b8d92f1fadd004a997.zip |
Use abstract SocketListener class
Makes the code more general and not directly tied to specifically
TCP sockets.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 8 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/RFBGlue.cc | 2 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 14 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.h | 12 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/vncExtInit.cc | 4 |
5 files changed, 20 insertions, 20 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index c8098f70..db917975 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -291,7 +291,7 @@ int main(int argc, char** argv) signal(SIGINT, CleanupSignalHandler); signal(SIGTERM, CleanupSignalHandler); - std::list<TcpListener*> listeners; + std::list<SocketListener*> listeners; try { TXWindow::init(dpy,"x0vncserver"); @@ -313,7 +313,7 @@ int main(int argc, char** argv) const char *hostsData = hostsFile.getData(); FileTcpFilter fileTcpFilter(hostsData); if (strlen(hostsData) != 0) - for (std::list<TcpListener*>::iterator i = listeners.begin(); + for (std::list<SocketListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) (*i)->setFilter(&fileTcpFilter); @@ -335,7 +335,7 @@ int main(int argc, char** argv) FD_ZERO(&wfds); FD_SET(ConnectionNumber(dpy), &rfds); - for (std::list<TcpListener*>::iterator i = listeners.begin(); + for (std::list<SocketListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) FD_SET((*i)->getFd(), &rfds); @@ -387,7 +387,7 @@ int main(int argc, char** argv) } // Accept new VNC connections - for (std::list<TcpListener*>::iterator i = listeners.begin(); + for (std::list<SocketListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) { if (FD_ISSET((*i)->getFd(), &rfds)) { diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc index c9153364..c09dfe6c 100644 --- a/unix/xserver/hw/vnc/RFBGlue.cc +++ b/unix/xserver/hw/vnc/RFBGlue.cc @@ -199,7 +199,7 @@ int vncIsTCPPortUsed(int port) { try { // Attempt to create TCPListeners on that port. - std::list<network::TcpListener*> dummy; + std::list<network::SocketListener*> dummy; network::createTcpListeners (&dummy, 0, port); while (!dummy.empty()) { delete dummy.back(); diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 080943d0..4aac7655 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -32,7 +32,7 @@ #include <fcntl.h> #include <sys/utsname.h> -#include <network/TcpSocket.h> +#include <network/Socket.h> #include <rfb/Exception.h> #include <rfb/VNCServerST.h> #include <rfb/HTTPServer.h> @@ -107,8 +107,8 @@ public: XserverDesktop::XserverDesktop(int screenIndex_, - std::list<network::TcpListener*> listeners_, - std::list<network::TcpListener*> httpListeners_, + std::list<network::SocketListener*> listeners_, + std::list<network::SocketListener*> httpListeners_, const char* name, const rfb::PixelFormat &pf, int width, int height, void* fbptr, int stride) @@ -127,13 +127,13 @@ XserverDesktop::XserverDesktop(int screenIndex_, if (!httpListeners.empty ()) httpServer = new FileHTTPServer(this); - for (std::list<TcpListener*>::iterator i = listeners.begin(); + for (std::list<SocketListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) { vncSetNotifyFd((*i)->getFd(), screenIndex, true, false); } - for (std::list<TcpListener*>::iterator i = httpListeners.begin(); + for (std::list<SocketListener*>::iterator i = httpListeners.begin(); i != httpListeners.end(); i++) { vncSetNotifyFd((*i)->getFd(), screenIndex, true, false); @@ -386,10 +386,10 @@ void XserverDesktop::handleSocketEvent(int fd, bool read, bool write) } bool XserverDesktop::handleListenerEvent(int fd, - std::list<TcpListener*>* sockets, + std::list<SocketListener*>* sockets, SocketServer* sockserv) { - std::list<TcpListener*>::iterator i; + std::list<SocketListener*>::iterator i; for (i = sockets->begin(); i != sockets->end(); i++) { if ((*i)->getFd() == fd) diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index f1c3e3e7..f866a4cc 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -44,7 +44,7 @@ namespace rfb { class VNCServerST; } -namespace network { class TcpListener; class Socket; class SocketServer; } +namespace network { class SocketListener; class Socket; class SocketServer; } class XserverDesktop : public rfb::SDesktop, public rfb::FullFramePixelBuffer, public rdr::Substitutor, @@ -53,8 +53,8 @@ class XserverDesktop : public rfb::SDesktop, public rfb::FullFramePixelBuffer, public: XserverDesktop(int screenIndex, - std::list<network::TcpListener*> listeners_, - std::list<network::TcpListener*> httpListeners_, + std::list<network::SocketListener*> listeners_, + std::list<network::SocketListener*> httpListeners_, const char* name, const rfb::PixelFormat &pf, int width, int height, void* fbptr, int stride); virtual ~XserverDesktop(); @@ -109,7 +109,7 @@ public: protected: bool handleListenerEvent(int fd, - std::list<network::TcpListener*>* sockets, + std::list<network::SocketListener*>* sockets, network::SocketServer* sockserv); bool handleSocketEvent(int fd, network::SocketServer* sockserv, @@ -122,8 +122,8 @@ private: int screenIndex; rfb::VNCServerST* server; rfb::HTTPServer* httpServer; - std::list<network::TcpListener*> listeners; - std::list<network::TcpListener*> httpListeners; + std::list<network::SocketListener*> listeners; + std::list<network::SocketListener*> httpListeners; bool directFbptr; uint32_t queryConnectId; diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc index 54cca953..f2674511 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -173,8 +173,8 @@ void vncExtensionInit(void) for (int scr = 0; scr < vncGetScreenCount(); scr++) { if (!desktop[scr]) { - std::list<network::TcpListener*> listeners; - std::list<network::TcpListener*> httpListeners; + std::list<network::SocketListener*> listeners; + std::list<network::SocketListener*> httpListeners; if (scr == 0 && vncInetdSock != -1) { if (network::TcpSocket::isListening(vncInetdSock)) { |