Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][apps] Fixed wrong +W epoll for listener socket in the test apps #1831

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10784,6 +10784,11 @@ int srt::CUDT::processConnectRequest(const sockaddr_any& addr, CPacket& packet)

HLOGC(cnlog.Debug, log << CONID() << "processConnectRequest: received a connection request");

// NOTE (IMPORTANT!!!)
//
// The current CUDT object represents a LISTENER SOCKET to which
// the request was redirected from the receiver queue.

if (m_bClosing)
{
m_RejectReason = SRT_REJ_CLOSE;
Expand Down
4 changes: 2 additions & 2 deletions testing/testmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void SrtCommon::PrepareListener(string host, int port, int backlog)

if (!m_blocking_mode)
{
srt_conn_epoll = AddPoller(m_bindsock, SRT_EPOLL_OUT);
srt_conn_epoll = AddPoller(m_bindsock, SRT_EPOLL_IN);
}

auto sa = CreateAddr(host, port);
Expand Down Expand Up @@ -547,7 +547,7 @@ void SrtCommon::AcceptNewClient()

int len = 2;
SRTSOCKET ready[2];
while (srt_epoll_wait(srt_conn_epoll, 0, 0, ready, &len, 1000, 0, 0, 0, 0) == -1)
while (srt_epoll_wait(srt_conn_epoll, ready, &len, 0, 0, 1000, 0, 0, 0, 0) == -1)
{
if (::transmit_int_state)
Error("srt_epoll_wait for srt_accept: interrupt");
Expand Down