]> git.seodisparate.com - UDPConnection/log
UDPConnection
5 weeks agoDocs: remove mention of heartbeat-rate-change fn dev master
Stephen Seo [Thu, 13 Mar 2025 10:08:11 +0000 (19:08 +0900)]
Docs: remove mention of heartbeat-rate-change fn

5 weeks agoUpdate README.md
Stephen Seo [Thu, 13 Mar 2025 10:03:09 +0000 (19:03 +0900)]
Update README.md

5 weeks agoUpdate README.md
Stephen Seo [Thu, 13 Mar 2025 10:00:33 +0000 (19:00 +0900)]
Update README.md

5 weeks agoRevert all "change heartbeat time" code
Stephen Seo [Thu, 13 Mar 2025 09:52:57 +0000 (18:52 +0900)]
Revert all "change heartbeat time" code

5 weeks agoRevert heartbeat interval fn, Version 1.5 1.5
Stephen Seo [Thu, 13 Mar 2025 08:37:17 +0000 (17:37 +0900)]
Revert heartbeat interval fn, Version 1.5

5 weeks agoMerge branch 'dev', version 1.4 1.4
Stephen Seo [Wed, 12 Mar 2025 08:46:51 +0000 (17:46 +0900)]
Merge branch 'dev', version 1.4

Fix timeouts with long heartbeat interval durations.

5 weeks agoVersion 1.4
Stephen Seo [Wed, 12 Mar 2025 08:46:39 +0000 (17:46 +0900)]
Version 1.4

5 weeks agoFix packet timeout with large heartbeat times
Stephen Seo [Wed, 12 Mar 2025 08:44:41 +0000 (17:44 +0900)]
Fix packet timeout with large heartbeat times

5 weeks agoRemove unused includes
Stephen Seo [Wed, 12 Mar 2025 08:44:27 +0000 (17:44 +0900)]
Remove unused includes

5 weeks agoMerge branch 'dev', version 1.3 1.3
Stephen Seo [Wed, 12 Mar 2025 07:07:06 +0000 (16:07 +0900)]
Merge branch 'dev', version 1.3

5 weeks agoUpdate UDPC.h doxygen documentation
Stephen Seo [Wed, 12 Mar 2025 07:06:48 +0000 (16:06 +0900)]
Update UDPC.h doxygen documentation

5 weeks agoUpdate README.md
Stephen Seo [Wed, 12 Mar 2025 06:44:05 +0000 (15:44 +0900)]
Update README.md

5 weeks agoUpdate LICENSE year
Stephen Seo [Wed, 12 Mar 2025 06:39:14 +0000 (15:39 +0900)]
Update LICENSE year

5 weeks agoAdd option to set heartbeat interval in test
Stephen Seo [Wed, 12 Mar 2025 06:33:13 +0000 (15:33 +0900)]
Add option to set heartbeat interval in test

5 weeks agoAdd function to change heartbeat interval
Stephen Seo [Wed, 12 Mar 2025 06:21:57 +0000 (15:21 +0900)]
Add function to change heartbeat interval

5 weeks agoUse std::shared_mutex for peerPKWhitelist
Stephen Seo [Wed, 12 Mar 2025 06:20:01 +0000 (15:20 +0900)]
Use std::shared_mutex for peerPKWhitelist

Unlike most mutex usages in UDPC, this mutex sometimes does read-only
operations, so it makes sense to use a std::shared_mutex here.

5 weeks agoUse constexpr for constants
Stephen Seo [Wed, 12 Mar 2025 06:19:02 +0000 (15:19 +0900)]
Use constexpr for constants

5 weeks agoUpdate CMake version, c++ std 17, version 1.3
Stephen Seo [Wed, 12 Mar 2025 06:17:43 +0000 (15:17 +0900)]
Update CMake version, c++ std 17, version 1.3

5 weeks agoUpdate README.md
Stephen Seo [Tue, 11 Mar 2025 11:32:10 +0000 (20:32 +0900)]
Update README.md

Remove links to git.seodisparate.com as I no longer host a repository
(and conan repository) there.

9 months agoUpdate release action/workflow
Stephen Seo [Sun, 14 Jul 2024 02:51:47 +0000 (11:51 +0900)]
Update release action/workflow

9 months agoVersion 1.2 1.2
Stephen Seo [Sat, 13 Jul 2024 13:42:53 +0000 (22:42 +0900)]
Version 1.2

Conan configuration was changed, so bump version for it.

9 months agoMinor fix to info in release action/workflow
Stephen Seo [Sat, 13 Jul 2024 08:12:46 +0000 (17:12 +0900)]
Minor fix to info in release action/workflow

9 months agoRelease versions of UDPC without libsodium
Stephen Seo [Sat, 13 Jul 2024 07:02:02 +0000 (16:02 +0900)]
Release versions of UDPC without libsodium

9 months agoUpdate release info in release action/workflow
Stephen Seo [Sat, 13 Jul 2024 06:29:41 +0000 (15:29 +0900)]
Update release info in release action/workflow

9 months agoAdd forgejo workflow to build and publish library
Stephen Seo [Sat, 13 Jul 2024 05:47:29 +0000 (14:47 +0900)]
Add forgejo workflow to build and publish library

9 months agoUpdate version to 1.1 1.1
Stephen Seo [Sat, 13 Jul 2024 04:44:00 +0000 (13:44 +0900)]
Update version to 1.1

Specify "SOVERSION" for shared lib so that libUDPC.so.1 is the default
instead of libUDPC.so.1.0 .

9 months agoUpdate README.md
Stephen Seo [Sat, 13 Jul 2024 04:18:43 +0000 (13:18 +0900)]
Update README.md

9 months agoUpdate README.md
Stephen Seo [Sat, 13 Jul 2024 02:42:53 +0000 (11:42 +0900)]
Update README.md

9 months agoUpdate README.md 1.0
Stephen Seo [Fri, 12 Jul 2024 07:39:43 +0000 (16:39 +0900)]
Update README.md

9 months agoAdd link to published conan package
Stephen Seo [Fri, 12 Jul 2024 07:38:13 +0000 (16:38 +0900)]
Add link to published conan package

9 months agoRework unit-tests to not use GTest
Stephen Seo [Fri, 12 Jul 2024 06:52:53 +0000 (15:52 +0900)]
Rework unit-tests to not use GTest

14 months agoHave forgejo action/workflow use "any_archLinux"
Stephen Seo [Mon, 22 Jan 2024 02:12:58 +0000 (11:12 +0900)]
Have forgejo action/workflow use "any_archLinux"

15 months agostd::atomic doesn't need volatile
Stephen Seo [Sun, 14 Jan 2024 01:31:38 +0000 (10:31 +0900)]
std::atomic doesn't need volatile

15 months agoReduce verbosity of unit test logs
Stephen Seo [Fri, 12 Jan 2024 07:36:01 +0000 (16:36 +0900)]
Reduce verbosity of unit test logs

15 months agoAllow move for TSLQIter
Stephen Seo [Fri, 12 Jan 2024 07:32:42 +0000 (16:32 +0900)]
Allow move for TSLQIter

Should fix builds of UDPConnection.cpp with "-std=c++11".

15 months agoGithub action: ensure current ref is checked out
Stephen Seo [Fri, 12 Jan 2024 05:31:36 +0000 (14:31 +0900)]
Github action: ensure current ref is checked out

15 months agoUse apt-get, add libsodium dep to github action
Stephen Seo [Fri, 12 Jan 2024 05:29:49 +0000 (14:29 +0900)]
Use apt-get, add libsodium dep to github action

15 months agoAdd Github action to run UnitTests
Stephen Seo [Fri, 12 Jan 2024 05:26:11 +0000 (14:26 +0900)]
Add Github action to run UnitTests

15 months agoAdd action/workflow to run UnitTest
Stephen Seo [Fri, 12 Jan 2024 05:06:14 +0000 (14:06 +0900)]
Add action/workflow to run UnitTest

15 months agoAdd UnitTest file for CXX11_shared_spin_lock
Stephen Seo [Fri, 12 Jan 2024 04:55:28 +0000 (13:55 +0900)]
Add UnitTest file for CXX11_shared_spin_lock

15 months agoTweak compare_exchange_weak(...) in spin-lock
Stephen Seo [Tue, 19 Dec 2023 04:47:19 +0000 (13:47 +0900)]
Tweak compare_exchange_weak(...) in spin-lock

15 months agoFix invalid use of mutex in TSLQueue
Stephen Seo [Mon, 23 Oct 2023 06:53:52 +0000 (15:53 +0900)]
Fix invalid use of mutex in TSLQueue

Mutex was removed in favor of the custom SharedSpinLock.

15 months agoDon't fail on "try" fns if failed to get spinLock
Stephen Seo [Thu, 19 Oct 2023 12:07:08 +0000 (21:07 +0900)]
Don't fail on "try" fns if failed to get spinLock

In SharedSpinLock: Only fail on "try" fns after spinLock was acquired
and condition is not met.

15 months agoRefactor shared-spin-lock to use atomic "spinLock"
Stephen Seo [Wed, 18 Oct 2023 13:28:40 +0000 (22:28 +0900)]
Refactor shared-spin-lock to use atomic "spinLock"

15 months agoMinor refactorings
Stephen Seo [Sat, 22 Jul 2023 10:07:32 +0000 (19:07 +0900)]
Minor refactorings

15 months agoReland C++11 "shared_lock" with iter remove fix
Stephen Seo [Sat, 22 Jul 2023 09:58:36 +0000 (18:58 +0900)]
Reland C++11 "shared_lock" with iter remove fix

On iterator remove, the iterator will trade the read lock for a write
lock, and trade back for a read lock once the remove has been completed.

15 months agoAdd note in docs about update for UDPC_init(...)
Stephen Seo [Fri, 12 Jan 2024 04:31:36 +0000 (13:31 +0900)]
Add note in docs about update for UDPC_init(...)

15 months agoUpdate LICENSE year
Stephen Seo [Thu, 11 Jan 2024 12:05:21 +0000 (21:05 +0900)]
Update LICENSE year

15 months agoUpdate debug optimization flag
Stephen Seo [Thu, 11 Jan 2024 12:05:02 +0000 (21:05 +0900)]
Update debug optimization flag

15 months agoUnitTest for start/stop threaded update and fix
Stephen Seo [Thu, 11 Jan 2024 11:07:25 +0000 (20:07 +0900)]
UnitTest for start/stop threaded update and fix

15 months agoEnforce thread-safety on destroy context
Stephen Seo [Thu, 11 Jan 2024 10:40:15 +0000 (19:40 +0900)]
Enforce thread-safety on destroy context

15 months agoUse mutex when enabling/disabling threaded-update
Stephen Seo [Thu, 11 Jan 2024 10:00:27 +0000 (19:00 +0900)]
Use mutex when enabling/disabling threaded-update

15 months agoUse atomic_bool for auto-updating "flag"
Stephen Seo [Thu, 11 Jan 2024 09:42:06 +0000 (18:42 +0900)]
Use atomic_bool for auto-updating "flag"

15 months agoAdd note about usage of UDPC header in docs
Stephen Seo [Mon, 1 Jan 2024 08:15:55 +0000 (17:15 +0900)]
Add note about usage of UDPC header in docs

15 months agoNote in documentation about thread safety
Stephen Seo [Mon, 1 Jan 2024 03:25:04 +0000 (12:25 +0900)]
Note in documentation about thread safety

Basically, all functions should be thread-safe unless mentioned
otherwise.

16 months agoFixes to .forgejo/workflows/doxygen.yaml
Stephen Seo [Tue, 19 Dec 2023 07:44:02 +0000 (16:44 +0900)]
Fixes to .forgejo/workflows/doxygen.yaml

16 months agoUpdate README.md
Stephen Seo [Tue, 19 Dec 2023 03:59:10 +0000 (12:59 +0900)]
Update README.md

16 months agoUse rsync setting up seodisparate doxygen docs
Stephen Seo [Tue, 19 Dec 2023 03:54:52 +0000 (12:54 +0900)]
Use rsync setting up seodisparate doxygen docs

16 months agoAdd Forgejo workflow for doxygen docs
Stephen Seo [Tue, 19 Dec 2023 03:49:56 +0000 (12:49 +0900)]
Add Forgejo workflow for doxygen docs

21 months agoRevert "Impl "RWLock" for use in TSLQueue"
Stephen Seo [Sat, 22 Jul 2023 08:28:18 +0000 (17:28 +0900)]
Revert "Impl "RWLock" for use in TSLQueue"

This reverts commit cf27a6bb76f4dae2344d6061eb199e2b35eb754a.

The use of "shared_lock" in TSLQueue is unsafe because of two things:

  - The TSLQueue iterator takes a "read" lock.
  - The TSLQueue iterator can erase the current element.

21 months agoRevert "Replace unnecessary use of atomic in "shared_lock""
Stephen Seo [Sat, 22 Jul 2023 08:28:13 +0000 (17:28 +0900)]
Revert "Replace unnecessary use of atomic in "shared_lock""

This reverts commit b50e50b5fbdeaa3990984a6bda052bbb92c234a9.

21 months agoReplace unnecessary use of atomic in "shared_lock"
Stephen Seo [Sat, 22 Jul 2023 07:45:52 +0000 (16:45 +0900)]
Replace unnecessary use of atomic in "shared_lock"

21 months agoImpl "RWLock" for use in TSLQueue
Stephen Seo [Sat, 22 Jul 2023 07:29:19 +0000 (16:29 +0900)]
Impl "RWLock" for use in TSLQueue

This project supports C++11, and std::shared_lock was made available in
C++17, thus a "shared_spin_lock" was created with similar functionality.
This "shared_spin_lock" is used in TSLQueue.

21 months agoFix CMakeLists.txt, handle -Weffc++ warnings
Stephen Seo [Sat, 22 Jul 2023 04:25:43 +0000 (13:25 +0900)]
Fix CMakeLists.txt, handle -Weffc++ warnings

21 months agoUpdate README.md
Stephen Seo [Wed, 19 Jul 2023 02:35:28 +0000 (11:35 +0900)]
Update README.md

21 months agoAdd docs for UDPC_no* functions
Stephen Seo [Tue, 4 Jul 2023 02:41:45 +0000 (11:41 +0900)]
Add docs for UDPC_no* functions

21 months agoUpdate README.md
Stephen Seo [Mon, 3 Jul 2023 03:03:52 +0000 (12:03 +0900)]
Update README.md

21 months agoRefactor addr logprint via template specialization
Stephen Seo [Mon, 26 Jun 2023 05:01:42 +0000 (14:01 +0900)]
Refactor addr logprint via template specialization

22 months agoImpl "unsafe" versions of UDPC_atostr(...)
Stephen Seo [Thu, 22 Jun 2023 04:25:26 +0000 (13:25 +0900)]
Impl "unsafe" versions of UDPC_atostr(...)

These "unsafe" versions are guaranteed to not have the returned address
strings be overwritten by UDPC, but they must be manually free'd later
(as mentioned in the documentation).

22 months agoConditionally use UDPC_atostr internally
Stephen Seo [Thu, 22 Jun 2023 03:39:11 +0000 (12:39 +0900)]
Conditionally use UDPC_atostr internally

Previous implementation used UDPC_atostr() frequently. This commit
changes the implementation to only call UDPC_atostr() if the log level
of the code logging to output will cause the log to be output.

22 months agoAdd documentation for UDPC_atostr...
Stephen Seo [Thu, 22 Jun 2023 03:07:26 +0000 (12:07 +0900)]
Add documentation for UDPC_atostr...

22 months agoFix potential memory corruption bug
Stephen Seo [Wed, 21 Jun 2023 04:23:26 +0000 (13:23 +0900)]
Fix potential memory corruption bug

UDPC_atostr(...) uses a uint32_t as an offset into a buffer inside the
UDPC Context such that there can be at most 32 different addr-strings.
The call is thread-safe, up to a point (at most 32 concurrent calls will
return correct strings). The problem was that the offset was not being
reset to 0 and was always being incremented by 40. Should the offset
overflow, the offset into the buffer will be "mis-aligned" such that the
32nd offset into the buffer can possibly overwrite memory past the
buffer's end if the addr string is long enough.

The fix is to use a mutex instead of an atomic uint32_t to lock a
code-block that will always prevent overflow (using modulus operator).

I think the speed-loss is negligable (using a lock instead of an atomic
uint32_t) since it isn't expected for programs using UDPC to use
UDPC_atostr(...) very frequently.

2 years agoFix potential nullptr deref in free_PacketInfo_ptr
Stephen Seo [Wed, 19 Apr 2023 10:11:03 +0000 (19:11 +0900)]
Fix potential nullptr deref in free_PacketInfo_ptr

2 years agoAdd UDPC_free_PacketInfo_ptr(...)
Stephen Seo [Wed, 19 Apr 2023 09:26:45 +0000 (18:26 +0900)]
Add UDPC_free_PacketInfo_ptr(...)

Also add unit test for this function.

2 years agoUpdate LICENSE year
Stephen Seo [Tue, 18 Apr 2023 05:05:52 +0000 (14:05 +0900)]
Update LICENSE year

2 years agoRefactor UDPC::get_empty_pinfo()
Stephen Seo [Tue, 18 Apr 2023 05:03:31 +0000 (14:03 +0900)]
Refactor UDPC::get_empty_pinfo()

2 years agoImpl handling Ctrl-C for Windows in NetworkTest
Stephen Seo [Tue, 10 Jan 2023 03:14:57 +0000 (12:14 +0900)]
Impl handling Ctrl-C for Windows in NetworkTest

2 years agoBetter handling of receiving packets in recv loop
Stephen Seo [Tue, 10 Jan 2023 02:51:54 +0000 (11:51 +0900)]
Better handling of receiving packets in recv loop

On error processing a received packet, continue to receive packets in
the loop. If no packet was received, the loop ends.

2 years agoUpdate documentation about UDPC_update(ctx)
Stephen Seo [Thu, 8 Dec 2022 07:54:02 +0000 (16:54 +0900)]
Update documentation about UDPC_update(ctx)

2 years agoReceive packets in loop til none left in interval
Stephen Seo [Sun, 4 Dec 2022 10:57:37 +0000 (19:57 +0900)]
Receive packets in loop til none left in interval

Also some formatting fixes (max 80 chars in edited code).

2 years agoUpdate LICENSE
Stephen Seo [Wed, 23 Nov 2022 05:14:05 +0000 (14:14 +0900)]
Update LICENSE

2 years agoHandle SIGINT (Ctrl-C) in NetworkTest
Stephen Seo [Wed, 23 Nov 2022 05:13:44 +0000 (14:13 +0900)]
Handle SIGINT (Ctrl-C) in NetworkTest

3 years agoUpdate README.md
Stephen Seo [Thu, 9 Sep 2021 09:13:38 +0000 (18:13 +0900)]
Update README.md

3 years agoAdd gh-pages workflow for Doxygen documentation
Stephen Seo [Thu, 9 Sep 2021 09:10:07 +0000 (18:10 +0900)]
Add gh-pages workflow for Doxygen documentation

3 years agoUpdate .gitignore
Stephen Seo [Mon, 30 Aug 2021 03:07:27 +0000 (12:07 +0900)]
Update .gitignore

3 years agoFix README.md
Stephen Seo [Wed, 25 Aug 2021 10:45:01 +0000 (19:45 +0900)]
Fix README.md

4 years agoUpdate README.md
Stephen Seo [Sun, 14 Feb 2021 04:56:26 +0000 (13:56 +0900)]
Update README.md

4 years agoUpdate year in LICENSE
Stephen Seo [Sun, 10 Jan 2021 05:40:38 +0000 (14:40 +0900)]
Update year in LICENSE

4 years agoAdd |id| to PacketInfo
Stephen Seo [Sun, 10 Jan 2021 05:40:17 +0000 (14:40 +0900)]
Add |id| to PacketInfo

4 years agoUse dll_export (for builds for Windows)
Stephen Seo [Tue, 23 Jun 2020 04:01:27 +0000 (13:01 +0900)]
Use dll_export (for builds for Windows)

4 years agoAttempt to make NetworkTest work on Windows
Stephen Seo [Tue, 28 Apr 2020 11:55:16 +0000 (20:55 +0900)]
Attempt to make NetworkTest work on Windows

4 years agoAdd/fix more documentation
Stephen Seo [Tue, 28 Apr 2020 10:38:07 +0000 (19:38 +0900)]
Add/fix more documentation

4 years agoMinor fixes
Stephen Seo [Mon, 27 Apr 2020 10:34:04 +0000 (19:34 +0900)]
Minor fixes

4 years agoFix check addr endianness in a4toa6 function
Stephen Seo [Mon, 27 Apr 2020 02:47:50 +0000 (11:47 +0900)]
Fix check addr endianness in a4toa6 function

4 years agoImpl create id with hostname
Stephen Seo [Sun, 26 Apr 2020 09:36:49 +0000 (18:36 +0900)]
Impl create id with hostname

Previously, ids could only be created with an ip address. Now they can
be made with a hostname, which will be looked up by UDPC.

Also fix client still requesting connections even if
accept-new-connections flag is false.

5 years agoMinor fix to documentation
Stephen Seo [Sat, 18 Apr 2020 07:19:59 +0000 (16:19 +0900)]
Minor fix to documentation

5 years agoUse memcpy instead of pointer casted assignment
Stephen Seo [Sat, 18 Apr 2020 07:09:00 +0000 (16:09 +0900)]
Use memcpy instead of pointer casted assignment

std::memcpy is used over int pointer casted assignment due to possible
alignment issues that may cause the casted pointer to be invalid.

5 years agoChange how UDPC_PacketInfo handles it's data
Stephen Seo [Wed, 15 Apr 2020 10:49:17 +0000 (19:49 +0900)]
Change how UDPC_PacketInfo handles it's data

The "data" member variable in UDPC_PacketInfo is now handled as a
pointer to dynamic data, instead of an array with a fixed size. Every
time a UDPC_PacketInfo is received from the context,
UDPC_free_PacketInfo() must be called on it to avoid a memory leak.

5 years agoFix compilation fail on no libsodium
Stephen Seo [Fri, 6 Mar 2020 04:03:47 +0000 (13:03 +0900)]
Fix compilation fail on no libsodium

5 years agoFix use of C++14/C++17, only C++11 is supported
Stephen Seo [Fri, 6 Mar 2020 03:05:33 +0000 (12:05 +0900)]
Fix use of C++14/C++17, only C++11 is supported