MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / webSocketSendTextMessage

Method webSocketSendTextMessage

Cutelyst/Server/protocolhttp.cpp:435–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435bool ProtoRequestHttp::webSocketSendTextMessage(const QString &message)
436{
437 if (headerConnection != ProtoRequestHttp::HeaderConnection::Upgrade) {
438 qCWarning(C_SERVER_HTTP)
439 << "Not sending websocket text message due connection header not upgraded"
440 << headerConnection << message.size();
441 return false;
442 }
443
444 const QByteArray rawMessage = message.toUtf8();
445 const QByteArray headers = ProtocolWebSocket::createWebsocketHeader(
446 ProtoRequestHttp::OpCodeText, quint64(rawMessage.size()));
447 return doWrite(headers) == headers.size() && doWrite(rawMessage) == rawMessage.size();
448}
449
450bool ProtoRequestHttp::webSocketSendBinaryMessage(const QByteArray &message)
451{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected