MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / PostTextMessage

Method PostTextMessage

src/render/plugins/net_ws/ws_stream_router.cpp:66–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 void WsStreamRouter::PostTextMessage(const std::string &data) {
67 if (!session_ || !session_->is_started()) {
68 return;
69 }
70
71 auto tid = tc::GetCurrentThreadID();
72 if (post_thread_id_ == 0) {
73 post_thread_id_ = tid;
74 }
75 if (tid != post_thread_id_) {
76 LOGI("OH NO! Post text message in thread: {}, but the last thread is: {}", tid, post_thread_id_);
77 }
78
79 session_->ws_stream().text(true);
80 queuing_message_count_++;
81 session_->async_send(data, [=, this](size_t byte_sent) {
82 queuing_message_count_--;
83
84 // report data size
85 auto plugin = Get<WsPlugin*>("plugin");
86 plugin->ReportSentDataSize(byte_sent);
87 });
88 }
89}

Callers

nothing calls this directly

Calls 1

ReportSentDataSizeMethod · 0.80

Tested by

no test coverage detected