Skip to content

Commit

Permalink
Added setting UPDATE event on group on new connection. Fixed test wit…
Browse files Browse the repository at this point in the history
…h accept timeout
  • Loading branch information
Mikolaj Malecki committed Sep 11, 2024
1 parent a516140 commit 461def5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 9 additions & 0 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,15 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,
// acknowledge INTERNAL users waiting for new connections on the listening socket
// that are reported when a new socket is connected within an already connected group.
m_EPoll.update_events(listen, ls->core().m_sPollID, SRT_EPOLL_UPDATE, true);
#if ENABLE_BONDING
// Note that the code in this current IF branch can only be executed in case
// of group members. Otherwise should_submit_to_accept will be always true.
if (ns->m_GroupOf)
{
HLOGC(gmlog.Debug, log << "GROUP UPDATE $" << ns->m_GroupOf->id() << " per connected socket @" << ns->m_SocketID);
m_EPoll.update_events(ns->m_GroupOf->id(), ns->m_GroupOf->m_sPollID, SRT_EPOLL_UPDATE, true);
}
#endif
CGlobEvent::triggerEvent();
}

Expand Down
5 changes: 1 addition & 4 deletions test/test_bonding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,12 @@ TEST(Bonding, DeadLinkUpdate)
cout << "[T] Killing the group and exitting.\n";
// And close
srt_close(group);

cout << "[T] exit\n";
});

cout << "Accepting (10s timeout)...\n";

SRTSOCKET lsnra [] = { listener };

// Using srt_accept_bond to apply accept timeout
SRTSOCKET lsnra [] = { listener };
const SRTSOCKET acp = srt_accept_bond(lsnra, 1, 10*1000);

EXPECT_NE(acp, -1) << "srt_accept:" << srt_getlasterror_str();
Expand Down

0 comments on commit 461def5

Please sign in to comment.