I'm using the following version of CEF/Chromium running on a Linux distro.
- Code: Select all
#define CHROME_VERSION_MAJOR 76
#define CHROME_VERSION_MINOR 0
#define CHROME_VERSION_BUILD 3809
#define CHROME_VERSION_PATCH 132
I have created an application (based on cefsimple) running on Linux that runs at
video frame rates (59.94Hz). I am using OSR with the external_begin_frame_enabled
set to true so that I can get OnPaint calls and control when the browser's BeginFrame
occurs.
When my top-of-frame occurs, I'm calling the SendExternalBeginFrame function on each
of the created browsers (in my case, I only have 1 browser).
Everything seems to be working great, until I started looking into my received websocket messages.
The HTML/JavaScript that I'm loading makes a connection to a local WebSocket server.
This local websocket server sends 2 ASCII messages (data length is 51 bytes) very
quickly back to back at top-of-frame before the Browser's SendExternalBeginFrame() is called.
I have used tcpdump to validate that these message are sent from the websocket server as
expected (around 100 us between packets).
I'm using performance.now() in JavaScript to determine when the websocket messages are
being received. I'm finding that they are spaced out by 8 ms most of the time.
- Code: Select all
CEF Data:
Data WS.bufferedAmount performance.now() (ms)
------------------------------------------------- ----------------- ----------------------
WS RX: { "command" : 99, "tickid" : 26941977, "id" : 0 } buffered: 0 7689.139999973122
WS RX: { "command" : 99, "tickid" : 26941977, "id" : 1 } buffered: 0 7698.870000021998
I have also done this same testing with Chromium (v74) but have not seen any issues.
- Code: Select all
Chromium Data:
Data WS.bufferedAmount performance.now() (ms)
------------------------------------------------- ----------------- ----------------------
WS RX: { "command" : 99, "tickid" : 26987826, "id" : 0 } buffered: 0 8057.359999977052
WS RX: { "command" : 99, "tickid" : 26987826, "id" : 1 } buffered: 0 8057.504999975208
Why are these being received over the JavaScript WebSocket interface around 8 ms apart with CEF?
Is there something in CEF that throttles the handling of websocket messages? Is there
anyway to get these to be handled like they are for Chromium?
Thanks in advance,
Dan