[feat] use SendReliableDataFrame() instead of SendDataFrame()

This commit is contained in:
dijunkun
2025-12-19 01:46:16 +08:00
parent 5066fcda48
commit a967dc72d7
4 changed files with 17 additions and 17 deletions

View File

@@ -92,8 +92,8 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
remote_action.d = i;
if (props->connection_status_ == ConnectionStatus::Connected) {
std::string msg = remote_action.to_json();
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str(), false);
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
}
}
props->display_selectable_hovered_ = ImGui::IsWindowHovered();
@@ -173,8 +173,8 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
remote_action.type = ControlType::audio_capture;
remote_action.a = props->audio_capture_button_pressed_;
std::string msg = remote_action.to_json();
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str(), false);
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
props->data_label_.c_str());
}
}
@@ -214,7 +214,7 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
int ret = sender.SendFile(
file_path, file_path.filename().string(),
[peer, file_label](const char* buf, size_t sz) -> int {
return SendDataFrame(peer, buf, sz, file_label.c_str(), true);
return SendReliableDataFrame(peer, buf, sz, file_label.c_str());
});
if (ret != 0) {