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.
| 234 | // use it for high connection rates as well. |
| 235 | // |
| 236 | void |
| 237 | NetAccept::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 | |
| 257 | int |
| 258 | NetAccept::accept_per_thread(int /* event ATS_UNUSED */, void * /* ep ATS_UNUSED */) |
no test coverage detected