Basic infrastructure to support fences.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4798 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index 3762fbb..ea56543 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2011 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +21,7 @@
#include <rfb/Exception.h>
#include <rfb/Security.h>
#include <rfb/msgTypes.h>
+#include <rfb/fenceTypes.h>
#include <rfb/SMsgReaderV3.h>
#include <rfb/SMsgWriterV3.h>
#include <rfb/SConnection.h>
@@ -329,3 +331,14 @@
}
}
}
+
+void SConnection::fence(rdr::U32 flags, unsigned len, const char data[])
+{
+ if (!(flags & fenceFlagRequest))
+ return;
+
+ // We cannot guarantee any synchronisation at this level
+ flags = 0;
+
+ writer()->writeFence(flags, len, data);
+}