MCPcopy Create free account
hub / github.com/F-Stack/f-stack / DetachConn

Method DetachConn

adapter/micro_thread/mt_net.cpp:547–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547void CNetHandler::DetachConn()
548{
549 CSockLink* conn = (CSockLink*)this->_conn_ptr;
550 if (NULL == conn)
551 {
552 MTLOG_DEBUG("net handler not set");
553 return;
554 }
555
556 if (_state_flags == 0)
557 {
558 return;
559 }
560
561 if (_state_flags & STATE_IN_CONNECT)
562 {
563 conn->RemoveFromList(CSockLink::LINK_CONN_LIST, this);
564 _state_flags &= ~STATE_IN_CONNECT;
565 }
566
567 if (_state_flags & STATE_IN_SEND)
568 {
569 conn->RemoveFromList(CSockLink::LINK_SEND_LIST, this);
570 _state_flags &= ~STATE_IN_SEND;
571 }
572
573 if (_state_flags & STATE_IN_RECV)
574 {
575 conn->RemoveFromList(CSockLink::LINK_RECV_LIST, this);
576 _state_flags &= ~STATE_IN_RECV;
577 }
578
579 if (_state_flags & STATE_IN_IDLE)
580 {
581 conn->RemoveFromList(CSockLink::LINK_IDLE_LIST, this);
582 _state_flags &= ~STATE_IN_IDLE;
583 }
584}
585
586uint32_t CNetHandler::HashValue()
587{

Callers 5

UnlinkMethod · 0.95
SwitchToConnMethod · 0.95
SwitchToSendMethod · 0.95
SwitchToRecvMethod · 0.95
SwitchToIdleMethod · 0.95

Calls 1

RemoveFromListMethod · 0.80

Tested by

no test coverage detected