Commits on Feb 13, 2019
* Offload I/O from ScheduledExecutorService thread in PaceMaker.
Commits on Feb 12, 2019
Commits on Feb 11, 2019
…er (#170) * Added periodic runnable to offload I/O from ScheduledExecutorService's thread. * Added missing class header. * Do not invoke `getMillisecondsDelayUntilNextRun` from synchronized section. * Use java.time.Duration to represent time interval. * Use synchronized block in scheduleNextRun.
Commits on Jan 15, 2019
* Use type with tiny interface (offer/poll/scan/isEmpty) for socket receive buffer. * Fixed computation of total bytes stored in buffer due to misuse of iterator and addAll methods of list. * Rename offer back to add and do not return status. * Fixed formatting. * Declare variables as final. * Check if `toMove` is empty, because it can not be null with new SocketReceiveBuffer. * Fix after rebase.
Commits on Jan 11, 2019
…v6. (#156) * Do not limit DISABLE_LINK_LOCAL_ADDRESSES to IPv6. * Removed part about IPv6 for in comment for DISABLE_LINK_LOCAL_ADDRESSES.
Commits on Jan 8, 2019
Use pool of datagram packets inside MultiplexingXXXSocketSupport to reduce clone() overhead.
Commits on Dec 19, 2018
…tagramSocket. (#166) * Use ReadWriteLock to split receive and close execution in SafeCloseDatagramSocket. * Me into authors lists. * Removed empty try/finally
Commits on Dec 17, 2018
* Invoke releasePacket on dropped items in PacketQueue. * Fixed comment. * Use Object.notify instead of Object.notifyAll in PacketQueue.doAdd * Fixed formatting. * Use atomic for numDroppedPackets because it is no longer under synchronized block. * Copy number of dropped packets to local variable.
Commits on Dec 12, 2018
* Do not explicitly create threads in PacketQueue, but borrow threads for execution from ExecutorService. * Added method to release created packet in PacketQueue. * Added constructor overload to override default ExecutorService of PacketQueue. * Fixed inconsistent formatting. * Added throttling support to PacketQueue. * Added performance tests for various configurations of PacketQueue. * Updated comments. * Added test for fixed size thread pool to compare it with ForkJoinPool. * Fixed comments. * Changed default values of PacketQueue configuration to closer match old implementation. * Removed unused constants. * Added tests to reveal introduced bug. Fixed bug. * Fixed comments in PacketsQueue. * Do not hard code class name in thread pool name. * Return 0 when handler is null (should be not be reachable, but anyway). * Added test to check capacity constraint of PacketQueue. * Replaced manual capacity check with checking offer return value. * Made throttler class static. * Added test to check that PacketQueue thread is release without work. * Do GC before running performance benchmark. * Fixed formatting and added timeout. * Added test to check cooperative multi-tasking behavior when executor is shared between queues and has less threads then executor has. * Minor code rearrangement. * Use dedicated syncronization object for sate of AsyncPacketReader. * Stop PacketQueue when benchmark is finished. * Added constant for number of benchmark iterations. * Minor code style enhancements. * Added myself to the list of authors. * Added test to check that million of PacketQueue can share single thread without eating CPU when idle. * Extracted AsyncQueueHandler class. * Fixed imports. * Minor fixes. * Minimize diff by undoing unnecessary changes. * Minimized diff. * Reduce diff. * Added constructor argument null checks. * Removed throttling and simplified AsyncQueueHandler. * Reviewed usage of syncronized blocks. * Moved variable closer to usage. * Fixed according to code review. * Added extra constructor. * Removed cancel from onYield because it's unnecessary after removing throttling. * Rearranged onYield and handleQueueItemsUntilEmpty, introduced rescheduleReader * Updated copyright.
Commits on Dec 10, 2018
Commits on Nov 29, 2018
#155) * Use shared thread pool to execute stun messages decoding and processing. Set minimum required Java version to 1.8. * Added missing argument comment. * Added pooling of MessageProcessor objects to avoid extra allocations per RawMessage. * Made MessageProcessor to be ForkJoinTask<Void> to avoid hidden allocation inside ForkJoinPool. * Fixed comments according to last changes. * Added dedicated method to reset state of pooled processor. More comments. * Fixed comment typo. * ForkJoinPool by default uses all available processors. * Rollback JDK 8 changes in pom file since it looks they were only necessary for local build due to misconfigured IDE. * Avoid usage of Java 8 features (lambda expressions & method references) * Revert "Rollback JDK 8 changes in pom file since it looks they were only necessary for local build due to misconfigured IDE." This reverts commit 840f18a. * Revert "Avoid usage of Java 8 features (lambda expressions & method references)" This reverts commit b6ce70e. * Renamed MessageProcessor into MessageProcessingTask to better reflect changed meaning of class. * Use ForkJoinPool with prefixed threads to simplify debugging. * Removed todo. * Use well-known thread pool instead of ForkJoinPool. Could be easily changed back to ForkJoinPool. * Fixed missing space. * Fixes according to code review. * Fixed active tasks tracking which was broken when pooling was added. * Keep track of task processing throughput via QueueStatistics. * Updated comment. * Fixed comment. * Updated comment. * Updated comment. * Updated comment. * Renamed field to have better name. * Fixed formatting. * Restored old formatting corrupted by IDE. * Fixed formatting. * Fixed comment. * Fixed comment. * Updated comment. * Updated log message. * Code-style fixes to match rest of file. * Fixed code style to match existing code. * Fixed formatting. * Restored accidentally removed comment. * Added myself to list of authors.
Commits on Nov 20, 2018
#154) * Reorder fields so final fields set in constructor come first, then mutable state of transaction. * Rename STUN transaction lifetime field. * Eliminate isRetransmitting field which is actually computed property from response != null * Use monotonic clock (System.nanoTime) to check expiration. Replaced synchronized methods with atomic variables. * Re-factored TransactionID implementation. Use less mutable state. Fixed hash function to produce random values, instead of sequentially growing values. * Do no perform full Hashtable lookup to find transaction with specified ID. * Use check before acquiring lock in StunStack. * Implement ScheduledExecutorService based expired transaction collector. * Restored self-cancel of expired server transactions collector when no server transactions at all. * Fixed isExpire check in StunServerTransaction * Fixed collection runnable to remove not only values but also keys from Hashtable. * Perform elapsed check over milliseconds, not nanoseconds. * Do not leave null values in clientTransactions/serverTransactions Hashtables when removing transaction, but leaving it's ID in Hashtable. * Remove condition around cheap logger calls. * Minor formatting fixes. * Log number of non-expired transactions after collection to verity it is not growing over time. * Fixed multi-line string formatting. * Moved construction of ScheduledThreadPoolExecutor to helper method. Adjusted default settings of pool. * Allow to create single threaded pool as well as bounded to number of CPUs on machine pool. * Fixed name collision with same class in other package. * Minor styling changes to reduce diff. * Removed unused import. * Do check of response when it's actually supposed to be non null. * Add actual length to error message. * Allow transaction ID of incorrect size. * Allow constructing TransactionID with invalid length. * Rollback all refactoring other than reducing thread count. * Use default 1 minute timeout for threads in pool. * Fixed typo in method name.
Commits on Oct 31, 2018
…Executor` (#153) * Hide Runnable interface in StunClientTransaction class. * Use CustomizableThreadFactory to give custom names to threads. * Extracted retransmission logic into separate class. * Re-implement Retransmitter with ScheduledThreadPoolExecutor. * Fixed retransmissionCounter increment. * Directly call logger fine methods instead overload with Level.
Commits on Oct 30, 2018
…read & Timer. (#152) * Eliminate "ICE PaceMaker" thread & Timer inside ConnectivityCheckClient. * Fixed PaceMaker stop and cleaning. * Added braces to have explicit blocks for one-liners if/else.
Commits on Oct 29, 2018
…ead. (#151) * Use ScheduleExecutorService to run STUN keep alives. * Mark threads as daemon threads. * Fixed comments. Rearranged properties read in keep alive runnable. * Added early check that keep alives must not be sent * Renamed method to check keep alive condition. * Fixed formatting. * Renamed metrod which check if KA should run. * Created CustomizableThreadFactory which support thread name prefixes and if threads are daemons. * Created dedicated runnable class which perform STUN keep-alive checks. * Minor comments fixes. * Do not expose Runnable interface from StunKeepAliveRunner. * Mark CustomizableThreadFactory fields as final. * Added java doc to CustomizableThreadFactory
Commits on Oct 24, 2018
…d. (#150) * Fix thread leak when Agent is freed before termination timer triggered. * Use ScheduledExecutorService to terminate agent with timeout * Fixed formatting to match project code style.