MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / sendAllBytes

Function sendAllBytes

src/Server/WebTerminalRequestHandler.cpp:71–81  ·  view source on GitHub ↗

Send all bytes to the socket, handling partial writes.

Source from the content-addressed store, hash-verified

69
70/// Send all bytes to the socket, handling partial writes.
71void sendAllBytes(Poco::Net::StreamSocket & socket, const char * data, size_t len)
72{
73 size_t total = 0;
74 while (total < len)
75 {
76 int sent = socket.sendBytes(data + total, static_cast<int>(len - total));
77 if (sent <= 0)
78 throw Poco::IOException("Failed to send bytes to WebSocket");
79 total += static_cast<size_t>(sent);
80 }
81}
82
83/// Send a WebSocket frame. Server-to-client frames are not masked.
84/// Header and payload are combined into a single buffer to avoid partial frame writes.

Callers 2

sendWebSocketFrameFunction · 0.85
handleWebSocketMethod · 0.85

Calls 1

sendBytesMethod · 0.45

Tested by

no test coverage detected