MCPcopy Create free account
hub / github.com/apache/brpc / SendLargeFile

Method SendLargeFile

example/http_c++/http_server.cpp:94–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 };
93
94 static void* SendLargeFile(void* raw_args) {
95 std::unique_ptr<Args> args(static_cast<Args*>(raw_args));
96 if (args->pa == NULL) {
97 LOG(ERROR) << "ProgressiveAttachment is NULL";
98 return NULL;
99 }
100 for (int i = 0; i < 100; ++i) {
101 char buf[16];
102 int len = snprintf(buf, sizeof(buf), "part_%d ", i);
103 args->pa->Write(buf, len);
104
105 // sleep a while to send another part.
106 bthread_usleep(10000);
107 }
108 return NULL;
109 }
110
111 void default_method(google::protobuf::RpcController* cntl_base,
112 const HttpRequest*,

Callers

nothing calls this directly

Calls 3

snprintfFunction · 0.85
bthread_usleepFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected