Move socket write event handling in to the RFB core
What to do when a socket is writeable should be handled in the
RFB core code as there may be other events we want to fire off
when this happens.
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 199524e..d501085 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -163,7 +163,7 @@
closingSockets.remove(sock);
}
-void VNCServerST::processSocketEvent(network::Socket* sock)
+void VNCServerST::processSocketReadEvent(network::Socket* sock)
{
// - Find the appropriate VNCSConnectionST and process the event
std::list<VNCSConnectionST*>::iterator ci;
@@ -176,6 +176,19 @@
throw rdr::Exception("invalid Socket in VNCServerST");
}
+void VNCServerST::processSocketWriteEvent(network::Socket* sock)
+{
+ // - Find the appropriate VNCSConnectionST and process the event
+ std::list<VNCSConnectionST*>::iterator ci;
+ for (ci = clients.begin(); ci != clients.end(); ci++) {
+ if ((*ci)->getSock() == sock) {
+ (*ci)->flushSocket();
+ return;
+ }
+ }
+ throw rdr::Exception("invalid Socket in VNCServerST");
+}
+
int VNCServerST::checkTimeouts()
{
int timeout = 0;