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

Method write_await

lib_acl_cpp/src/stream/aio_ostream.cpp:228–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void aio_ostream::write_await(const void* data, int len,
229 acl_int64 delay /* = 0 */, aio_timer_writer* callback /* = NULL */)
230{
231 if (delay > 0) {
232 disable_write();
233
234 aio_timer_writer* timer_writer;
235
236 if (callback != NULL) {
237 timer_writer= callback;
238 } else {
239 timer_writer = NEW aio_timer_writer();
240 }
241
242 // ���� timer_writer_ ����ij�Ա����
243 timer_writer->out_ = this;
244 timer_writer->buf_.copy(data, len);
245
246 // ����д���������ӳ��첽д�Ķ�����
247 if (timer_writers_ == NULL) {
248 timer_writers_ = NEW std::list<aio_timer_writer*>;
249 }
250 timer_writers_->push_back(timer_writer);
251 // ���ö�ʱ��
252 handle_->set_timer(timer_writer, delay);
253 return;
254 }
255
256 acl_assert(stream_);
257 acl_aio_writen(stream_, (const char*) data, len);
258}
259
260int aio_ostream::sendto(const void* data, int len, const char* dest_addr, int flags)
261{

Callers

nothing calls this directly

Calls 4

acl_aio_writenFunction · 0.85
set_timerMethod · 0.80
disable_writeFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected