diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-10-25 15:13:13 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-10-25 15:13:13 +0000 |
commit | 4ce51ffc4ec5fb060855dbe17579cbb3d9228e61 (patch) | |
tree | 77a584a327ef2e1ad6d50882943e5605bde10e81 /common/rdr/FdOutStream.h | |
parent | 7d4e88868a1304caafdc6bef84d0e94785f2ddb5 (diff) | |
download | tigervnc-4ce51ffc4ec5fb060855dbe17579cbb3d9228e61.tar.gz tigervnc-4ce51ffc4ec5fb060855dbe17579cbb3d9228e61.zip |
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
Diffstat (limited to 'common/rdr/FdOutStream.h')
-rw-r--r-- | common/rdr/FdOutStream.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/rdr/FdOutStream.h b/common/rdr/FdOutStream.h index a3e29127..daa88b24 100644 --- a/common/rdr/FdOutStream.h +++ b/common/rdr/FdOutStream.h @@ -31,23 +31,28 @@ namespace rdr { 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; }; } |