MCPcopy Create free account
hub / github.com/acl-dev/acl / do_echo

Method do_echo

lib_acl_cpp/samples/ssl/server/main.cpp:101–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 void do_echo(void) {
102 char buf[4096];
103
104 int times = 0;
105 while (true) {
106 int ret = conn_->read(buf, sizeof(buf), false);
107 if (ret == -1) {
108 if (acl::last_error() != EAGAIN) {
109 break;
110 }
111
112 printf("Times of timeout: %d\r\n", ++times);
113
114 if (times >= times_) {
115 break;
116 }
117
118 continue;
119 }
120
121 times = 0;
122
123 if (conn_->write(buf, ret) == -1) {
124 break;
125 }
126 }
127 }
128};
129
130//////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 3

last_errorFunction · 0.85
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected