MCPcopy Create free account
hub / github.com/Snapchat/Valdi / onMessage

Method onMessage

valdi/src/valdi/hermes/WebSocketServer/WebSocketServerImpl.cpp:170–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void WebSocketServerImpl::onMessage(websocketpp::connection_hdl hdl, WebSocketPPServer::message_ptr msg) {
171 auto connection = connectionFromHandle(hdl);
172 if (connection != nullptr) {
173 auto bytes = makeShared<Bytes>();
174 bytes->assignData(reinterpret_cast<const Byte*>(msg->get_payload().data()), msg->get_payload().size());
175 connection->dataReceived(BytesView(bytes));
176 }
177}
178
179void WebSocketServerImpl::onHttp(websocketpp::connection_hdl hdl) {
180 auto con = _server.get_con_from_hdl(hdl);

Callers

nothing calls this directly

Calls 5

assignDataMethod · 0.80
dataReceivedMethod · 0.80
BytesViewClass · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected