MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / SendMsg

Method SendMsg

src/plugin/net/src/AFCWebSocketClient.cpp:196–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196bool AFCWebSocketClient::SendMsg(const char* msg, const size_t msg_len, const AFGUID& session_id /* = 0*/)
197{
198 using namespace brynet::net::http;
199
200 auto frame = std::make_shared<std::string>();
201 WebSocketFormat::wsFrameBuild(msg, msg_len, *frame, WebSocketFormat::WebSocketFrameType::BINARY_FRAME, true, false);
202
203 if (client_session_ptr_->GetSession() != nullptr)
204 {
205 client_session_ptr_->GetSession()->send(frame);
206 }
207
208 return true;
209}
210
211bool AFCWebSocketClient::CloseSession(const AFGUID& session_id)
212{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected