Skip to content

Modified default SRT socket parameters#2

Open
brentyates-swx wants to merge 27 commits into
masterfrom
swxtch
Open

Modified default SRT socket parameters#2
brentyates-swx wants to merge 27 commits into
masterfrom
swxtch

Conversation

@brentyates-swx
Copy link
Copy Markdown

  • Now using 16K receive buffers
  • max payload size now 1456

cl-ment and others added 27 commits August 27, 2025 10:56
* [build] Update Ubuntu runners to 22.04.

* Update to googletest-1.12.1

* Remove Unit Tests from the ABI workflow.

* Use latest version of ubuntu

* Remove build-wrapper.

---------
Authored-by: Clément Gérouville <cgerouville@haivision.com>
Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
…sion#3179)

* [core] Cleanup SRT state after a fork() (issue Haivision#3177)

* Free socket memory without calling the destructor.

* Remove srt_cleanupAtFork() from the API.

* Make it compile on systems that don't support pthread_atfork()

* Remove a typo

* Avoid to send shutdown packet when cleaning up after a fork.

* Close the dangling UDP sockets, Free memory.

* Add TODO for freeing the Send Queue after refacttoring it.

* Ensure that CThread is joinable before join()

* Try fix iOS-cxxsyncOFF

* Replace the mutex pointer by a mutex reference.

* Refactor the Multiplexer initialization.

* Fix SIGSEGV

* Fix Compilation error on a Debug Log

* Rollback to cleaner code for the multiplexer initialization.

* Add compatibility with C++11 Sync.

* Apply code review changes

* Replace the resetThread() macro by an inline function.

Co-authored-by: Sektor van Skijlen <ethouris@gmail.com>

* Reset m_CGStopCond in CUDTUnited

* Rework of resetThread()

* Ensure Garbage collector is in the right state after fork.

* Protect ~CMultiplexer() against NULL pointers.

* Protect resetAtFork() and stop() against NULL pointers.

* Added fork example to the repository

* Remove french comments.

---------
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
Co-authored-by: Sektor van Skijlen <ethouris@gmail.com>
Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
* [core] Fixed reentrancy problem of srt_strerror

* [docs] Updated documentation for srt_strerror

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
* Fix SIGABRT when bonding option is too long

* Move the UT to test_bonding.cpp

---------

Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
…#3232)

* [MAINT] Add fixes for CI configuration based on latest dev

* Added fixes from another PR

* Added lacking scripts and repos

* Fixed error reported in CI. Fixed ABI entry

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
…orcing cookie values. (Haivision#3227)

* Initial testing version of the cookie contest fix

* Setting cookie contest 1.5.4 as default

* [core] Restored old cookie contest. Added ignored wrong peer response on cookie collision

* Fixed security report

* Removed the (unnecessary now) fix for the future version compatibility

* Update test/test_common.cpp - fixed a typo in a comment

* Fixed TestFEC tests to be resistant of a listener-readiness bug (fixed in dev)

* Try to fix the first issue

* Removed remains after the screw-in cookie procedures

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
…gorithm (Haivision#3220)

* Added more logs around rexmit bandwidth

* [API] raise libSRT version number to 1.5.5

* Maintenance changes

* Rewrite the Bandwidth estimation system.

* Merged changes from Clement's implementation

* Introduce CShaper to control the retransmission BW.

* Fixed with average packet size measurement

* Added self-adjusting of burst period

* Fixed wrong formulas and added some logs

* Removed old changes for CSndRateEstimator. Blocked the use of CSndRateEstimator.

* Applied most direct review fixes

* Refactoring: split packLostData into smaller parts

* Some cosmetic fixes

* Cosmetics

* Removed Tie function that was using non-C++03-compatible assignment

* Stretched connection timeout for accept in FEC tests

* Trying to track the problem in FEC tests on Mac

* Adjusted TestFEC tests to a bug in listener missing signal

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
…or SRT build (Haivision#3219)

* [BUILD] Added handling of LIBSRT_ prefix when setting cmake options for SRT build

* Added documentation

* Apply suggestions from code review

Co-authored-by: stevomatthews <smatthews@haivision.com>

* Fixed text alignment after doc review

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: stevomatthews <smatthews@haivision.com>
…3261)

Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>
…tion (Haivision#3259)

* [BUG] Prevent blocking srt_close call from interrupting connection

* Test: added check that srt_close call is not blocked. Ensured that waiting is interrupt ed on close. Ensured that the socket is closed right after wait quit

* Fixed incorrect C++17 literals

* Increased wait time tolerance for srt_close (failing on some slower CI machines)

---------

Co-authored-by: Mikołaj Małecki <mmalecki@haivision.com>
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
Haivision#3264)

* Detec IPv6 with colon to harden the check if IPv6 is used in the test.

Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>

* just relies on srt::CreateAddr to resolve IP family.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
…aivision#3263)

* fix bunch of typos and enable codespell via github workflow.

Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>

* address review comments.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* Replace instability by unstability and insecure by unsecure.

* Rollback instability!

* Moving the configuration files to scripts/codespell.

* Replace connenctions by connections.

---------

Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
…ision#3272)

* Fix group data length check in handshake processing

* Apply suggestions from code review

Changed the maximum size of copied data to the size of the array.

* Apply suggestion from @ethouris

Fixed through a separate variable.

---------

Co-authored-by: Sektor van Skijlen <ethouris@gmail.com>
…recognized per the same condition (Haivision#3290)

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
…et (Haivision#3291)

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
…n#3298)

* [BUG] Incorrect error code when srt_listen on closed socket

* Fixed API description

* Ask Codespell to ignore the TEST() macro.

* Replace few if statements by a switch statement.

* Status SRTS_NONEXIST throws MN_CLOSED instead of MN_ISUNBOUND

* Manage the rendez-vous case first

---------

Co-authored-by: Mikolaj Malecki <mmalecki@haivision.com>
Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
* [doc] Remove a badge (Travis)

* Update repology's badges

---------

Co-authored-by: Clément Gérouville <cgerouville@haivision.com>
* Now using 16K receive buffers
* max payload size now 1456
* sdmc-5910: Forcing MT when linking with runtime library on windows

* format
…ue growth

Three memory issues cause swx-protocol RSS to grow unboundedly (~450 MB/hr
with 84 SRT connections), eventually exhausting system memory.

Fix 1 - CSndBuffer initial size 32 → 2048 (core.cpp):
  Each increase() allocates unitsize * blockLen bytes. With unitsize=32,
  allocations are 46KB (below glibc mmap threshold), causing heap
  fragmentation that prevents RSS from shrinking. With unitsize=2048,
  allocations are 3MB (mmap-backed, returned cleanly on free).
  Also adds always-on logging to increase() for monitoring.

Fix 2 - epoll leak in accept_bond (api.cpp):
  Each srt_accept_bond() call creates a temp epoll, adds listeners, waits,
  then releases the epoll. But release doesn't remove the stale eid from
  listeners' m_sPollID set. Over time the set grows ~72KB/min. Fix: remove
  listeners from epoll before releasing.

Fix 3 - CUnitQueue shrinking (queue.cpp, queue.h):
  The receive packet pool (CUnitQueue) grows via increase_() but never
  shrinks. Added shrink_() that frees CQEntry blocks when all their units
  are free and utilization drops below 40%.
Comment thread srtcore/buffer_tools.h
typedef sync::steady_clock::time_point time_point;
typedef sync::steady_clock::duration duration;
CShaper (double min_tokens_capacity):
m_BurstPeriod(sync::milliseconds_from(BURSTPERIOD_DEFAULT())),
Comment thread srtcore/buffer_tools.h
{
// NOTE: comparison on double to check the PREVIOUSLY
// SET value (m_rate_Bps), not recalculated value.
if (bw_Bps != m_rate_Bps)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.