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

Method writePayload

Libraries/Http/HttpWebSocket.cpp:909–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907}
908
909Result HttpWebSocketFrameWriter::writePayload(Span<char> payload)
910{
911 SC_TRY_MSG(frameInProgress, "HttpWebSocketFrameWriter no frame in progress");
912 SC_TRY_MSG(payload.sizeInBytes() <= payloadBytesRemaining,
913 "HttpWebSocketFrameWriter payload exceeds declared frame length");
914
915 if (currentFrame.masked and not payload.empty())
916 {
917 scHttpWebSocketApplyMask(payload, currentFrame.maskKey, payloadBytesWritten);
918 }
919
920 payloadBytesWritten += payload.sizeInBytes();
921 payloadBytesRemaining -= payload.sizeInBytes();
922 return Result(true);
923}
924
925Result HttpWebSocketFrameWriter::finishFrame()
926{

Callers 4

encodeFrameFunction · 0.80
writerRoundtripMethod · 0.80
sendFrameMethod · 0.80
queueAutomaticControlMethod · 0.80

Calls 3

scHttpWebSocketApplyMaskFunction · 0.85
ResultClass · 0.50
sizeInBytesMethod · 0.45

Tested by 2

encodeFrameFunction · 0.64
writerRoundtripMethod · 0.64