MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / handle_client

Function handle_client

app/server/http.cpp:263–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 std::ostringstream header;
262 header << std::hex << data.size() << "\r\n";
263 send_all(socket_, header.str());
264 send_all(socket_, std::string(data));
265 send_all(socket_, "\r\n");
266 }
267
268 void finish() {
269 send_all(socket_, "0\r\n\r\n");
270 }
271
272private:
273 SocketHandle socket_;
274};
275
276UniqueSocket bind_listen_socket(const std::string & host, int port) {
277 UniqueSocket socket_handle(socket(AF_INET, SOCK_STREAM, 0));
278 if (socket_handle.get() == kInvalidSocket) {
279 throw std::runtime_error("could not create listen socket");

Callers

nothing calls this directly

Calls 6

read_http_requestFunction · 0.85
send_allFunction · 0.85
serialize_responseFunction · 0.85
error_responseFunction · 0.85
handleMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected