MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / sendData

Method sendData

Libraries/Http/HttpWebSocket.cpp:1087–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1085}
1086
1087Result HttpWebSocketEndpoint::sendData(HttpWebSocketOpcode opcode, Span<const char> payload, bool fin,
1088 const uint8_t* maskKey, Span<char> storage, Span<const char>& encodedFrame)
1089{
1090 SC_TRY_MSG(opcode == HttpWebSocketOpcode::Text or opcode == HttpWebSocketOpcode::Binary or
1091 opcode == HttpWebSocketOpcode::Continuation,
1092 "HttpWebSocketEndpoint sendData requires a data opcode");
1093 HttpWebSocketFrameHeaderView header;
1094 header.opcode = opcode;
1095 header.fin = fin;
1096 header.payloadLength = payload.sizeInBytes();
1097 SC_TRY(applyOutgoingMask(header, maskKey));
1098 return sendFrame(header, payload, storage, encodedFrame);
1099}
1100
1101Result HttpWebSocketEndpoint::sendPing(Span<const char> payload, const uint8_t* maskKey, Span<char> storage,
1102 Span<const char>& encodedFrame)

Callers 6

messageAssemblerMethod · 0.80
messageAssemblerLimitMethod · 0.80
sendDataHelperMethod · 0.80
connectionPumpMethod · 0.80
sendAfterUpgradeMethod · 0.80
broadcastTextMethod · 0.80

Calls 1

sizeInBytesMethod · 0.45

Tested by 5

messageAssemblerMethod · 0.64
messageAssemblerLimitMethod · 0.64
sendDataHelperMethod · 0.64
connectionPumpMethod · 0.64
sendAfterUpgradeMethod · 0.64