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

Method onData

Libraries/Http/HttpWebSocket.cpp:1372–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370}
1371
1372void HttpWebSocketConnectionPump::onData(AsyncBufferView::ID bufferID)
1373{
1374 if (not transport.isValid())
1375 {
1376 return;
1377 }
1378
1379 Span<char> data;
1380 Result dataResult = transport.buffersPool->getWritableData(bufferID, data);
1381 if (not dataResult)
1382 {
1383 fail(dataResult);
1384 return;
1385 }
1386
1387 size_t consumed = 0;
1388 Result received = endpoint.receive(data, consumed);
1389 if (received)
1390 {
1391 received = flushPendingControlFrame();
1392 }
1393 if (not received)
1394 {
1395 fail(received);
1396 }
1397}
1398
1399void HttpWebSocketConnectionPump::onStreamEnd()
1400{

Callers

nothing calls this directly

Calls 3

getWritableDataMethod · 0.80
isValidMethod · 0.45
receiveMethod · 0.45

Tested by

no test coverage detected