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

Method StartAccept

test/brpc_channel_unittest.cpp:309–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307 }
308
309 int StartAccept(butil::EndPoint ep) {
310 int listening_fd = -1;
311 while ((listening_fd = tcp_listen(ep)) < 0) {
312 if (errno == EADDRINUSE) {
313 bthread_usleep(1000);
314 } else {
315 return -1;
316 }
317 }
318 if (_messenger.StartAccept(listening_fd, -1, NULL, false) != 0) {
319 return -1;
320 }
321 return 0;
322 }
323
324 void StopAndJoin() {
325 _messenger.StopAccept(0);

Callers 2

TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 2

tcp_listenFunction · 0.85
bthread_usleepFunction · 0.85

Tested by

no test coverage detected