MCPcopy Create free account
hub / github.com/apache/trafficserver / init_accept

Method init_accept

src/iocore/net/UnixNetAccept.cc:236–255  ·  view source on GitHub ↗

Initialize the NetAccept for execution in a etype thread. This should be done for low connection rate sockets. (Management, Cluster, etc.) Also, since it adapts to the number of connections arriving, it should be reasonable to use it for high connection rates as well.

Source from the content-addressed store, hash-verified

234// use it for high connection rates as well.
235//
236void
237NetAccept::init_accept(EThread *t)
238{
239 if (!t) {
240 t = eventProcessor.assign_thread(ET_NET);
241 }
242
243 if (!action_->continuation->mutex) {
244 action_->continuation->mutex = t->mutex;
245 action_->mutex = t->mutex;
246 }
247
248 if (do_listen()) {
249 return;
250 }
251
252 SET_HANDLER(&NetAccept::acceptEvent);
253 period = -HRTIME_MSECONDS(net_accept_period);
254 t->schedule_every(this, period);
255}
256
257int
258NetAccept::accept_per_thread(int /* event ATS_UNUSED */, void * /* ep ATS_UNUSED */)

Callers 2

main_acceptMethod · 0.80
accept_internalMethod · 0.80

Calls 2

assign_threadMethod · 0.80
schedule_everyMethod · 0.45

Tested by

no test coverage detected