| 730 | ConnectionsCache.insert(std::make_pair(addr, connection)); |
| 731 | } |
| 732 | void Step() { |
| 733 | { |
| 734 | TGuard<TSpinLock> lock(CS); |
| 735 | DoSends(); |
| 736 | } |
| 737 | Host->Step(); |
| 738 | for (TIntrusivePtr<TStatsRequest> req; StatsReqList.Dequeue(&req);) { |
| 739 | switch (req->Req) { |
| 740 | case TStatsRequest::DEBUG_INFO: { |
| 741 | TGuard<TSpinLock> lock(CS); |
| 742 | req->DebugInfo = GetDebugInfoLocked(); |
| 743 | } |
| 744 | req->Complete.Signal(); |
| 745 | break; |
| 746 | case TStatsRequest::HAS_IN_REQUEST: { |
| 747 | TGuard<TSpinLock> lock(CS); |
| 748 | req->RequestFound = (InRequests.find(req->RequestId) != InRequests.end()); |
| 749 | } |
| 750 | req->Complete.Signal(); |
| 751 | break; |
| 752 | case TStatsRequest::GET_PEER_ADDRESS: { |
| 753 | TGuard<TSpinLock> lock(CS); |
| 754 | TInRequestHash::const_iterator i = InRequests.find(req->RequestId); |
| 755 | if (i != InRequests.end()) { |
| 756 | req->PeerAddress = i->second.Connection->GetAddress(); |
| 757 | } else { |
| 758 | TOutRequestHash::const_iterator o = OutRequests.find(req->RequestId); |
| 759 | if (o != OutRequests.end()) { |
| 760 | req->PeerAddress = o->second.Connection->GetAddress(); |
| 761 | } else { |
| 762 | req->PeerAddress = TUdpAddress(); |
| 763 | } |
| 764 | } |
| 765 | } |
| 766 | req->Complete.Signal(); |
| 767 | break; |
| 768 | case TStatsRequest::GET_PEER_QUEUE_STATS: |
| 769 | /* |
| 770 | // TODO: infinite stats |
| 771 | if (TIntrusivePtr<IConnection>* connection = ConnectionsCache.FindPtr(req->PeerAddress)) { |
| 772 | req->QueueStats = (*connection)->GetPendingDataSize(); |
| 773 | } |
| 774 | */ |
| 775 | Y_ABORT_UNLESS(false, "NOT IMPLEMENTED"); |
| 776 | |
| 777 | break; |
| 778 | default: |
| 779 | Y_ASSERT(0); |
| 780 | req->Complete.Signal(); |
| 781 | break; |
| 782 | } |
| 783 | } |
| 784 | { |
| 785 | TGuard<TSpinLock> lock(CS); |
| 786 | DoSends(); |
| 787 | ProcessIncomingPackets(); |
| 788 | AnalyzeSendResults(); |
| 789 | SendPingsIfNeeded(); |
no test coverage detected