Make socket writes non-blockable. This allows the system to more quickly
return back to the Xorg main loop, meaning that things will be more responsive
in the presence of slow VNC clients.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4735 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rdr/FdOutStream.h b/common/rdr/FdOutStream.h
index a3e2912..daa88b2 100644
--- a/common/rdr/FdOutStream.h
+++ b/common/rdr/FdOutStream.h
@@ -31,23 +31,28 @@
public:
- FdOutStream(int fd, int timeoutms=-1, int bufSize=0);
+ FdOutStream(int fd, bool blocking=true, int timeoutms=-1, int bufSize=0);
virtual ~FdOutStream();
void setTimeout(int timeoutms);
+ void setBlocking(bool blocking);
int getFd() { return fd; }
void flush();
int length();
+ int bufferUsage();
+
private:
int overrun(int itemSize, int nItems);
- int writeWithTimeout(const void* data, int length);
+ int writeWithTimeout(const void* data, int length, int timeoutms);
int fd;
+ bool blocking;
int timeoutms;
int bufSize;
int offset;
U8* start;
+ U8* sentUpTo;
};
}