Send binary WebSocket frames in one write
This commit is contained in:
@@ -65,6 +65,9 @@ typedef struct {
|
||||
uint32_t generation;
|
||||
} web_serial_work_t;
|
||||
|
||||
_Static_assert(WEB_SERIAL_TRANSPORT_TX_PAYLOAD_SIZE == WEB_HTTPD_WS_BINARY_MAX_PAYLOAD,
|
||||
"Reaudit bounded binary WS send when changing serial payload size");
|
||||
|
||||
typedef struct web_serial_slot {
|
||||
web_serial_slot_state_t state;
|
||||
httpd_handle_t server;
|
||||
@@ -1057,7 +1060,9 @@ static void web_serial_send_work(void *argument)
|
||||
};
|
||||
send_called = true;
|
||||
if (sample_epoch && performance_gate() == sample_epoch) send_start = esp_timer_get_time();
|
||||
result = httpd_ws_send_frame_async(server, socket_fd, &frame);
|
||||
result = type == HTTPD_WS_TYPE_BINARY
|
||||
? web_httpd_ws_send_binary(server, socket_fd, slot, slot->tx_data, length)
|
||||
: httpd_ws_send_frame_async(server, socket_fd, &frame);
|
||||
if (sample_epoch && performance_gate() == sample_epoch) send_end = esp_timer_get_time();
|
||||
if (result == ESP_OK) {
|
||||
(void)httpd_sess_update_lru_counter(server, socket_fd);
|
||||
|
||||
Reference in New Issue
Block a user