662 Commits

Author SHA1 Message Date
Yury Yaroshevich
513fb588d6 Stun client transaction re-transmission based on ScheduledThreadPoolExecutor (#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.
2018-10-31 10:53:41 -07:00
Yury Yaroshevich
3fe34dcb97 Reduce number of threads created by ice4j. Eliminate ICE PaceMaker thread & 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.
2018-10-30 16:11:48 -07:00
Yury Yaroshevich
6bed63795f Reduce number of threads created by ice4j. Eliminate StunKeepAliveThread. (#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
2018-10-29 16:47:20 -07:00
Yury Yaroshevich
ba7e30c189 Fix thread leak when Agent is freed before termination timer triggered. (#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.
2018-10-24 11:05:00 -05:00
bgrozev
7d2ad8f9a2
feat: Makes the use of a component socket optional. (#147)
* feat: Makes the use of a component socket optional.
2018-10-05 17:15:00 -05:00
bgrozev
4aef25b91f
fix: Makes sure the ReadThread continues running after an exception. (#144) 2018-07-13 14:42:04 -05:00
bgrozev
38e7b9226d
Log msg type (#138)
* ref: Minor cleanup.

* ref: Uses a constant.

* log: Logs the message type when a message encode fails.
2018-05-23 14:56:43 -05:00
Guus der Kinderen
59693a4894 AbstractUdpListener should be able to release its resources (#140)
* AbstractUdpListener should be able to release its resources

A new 'close' method has been added to AbstractUdpListener that is modeled after the 'close' implementation
of AbstractTcpListener.

This change can be used to prevent the issue described in https://github.com/jitsi/ice4j/issues/139

* Prevent concurrent modification of collection.

Part of the processing is removal from the collection that is being iterated over. To
avoid concurrent modification exceptions, a copy of the collection is made, prior to
iteration.

* Style fixes and added copyright notice.
2018-05-16 18:43:50 -04:00
Boris Grozev
200b383752 log: Adds details to an exception's message. 2018-03-23 14:53:23 -05:00
Guus der Kinderen
f2cd3891e1 Use field instead of local variable. 2017-11-16 15:32:15 -06:00
Guus der Kinderen
9810024b73 Fix negation bug. 2017-11-16 15:32:15 -06:00
Guus der Kinderen
48956f82ba Allow bind to wildcard (any) local address.
This commit allows the project to bind to any local address, by setting
a property.
2017-11-16 15:32:15 -06:00
bgrozev
a2e5ca1d4c Fixes a race condition leading to a thread stuck in receive() (#135)
* fix: Fixes a race condition leading to a thread

being stuck in AbstractUdpListener.MySocket#receive().

* minor: Braces, cleanup.
2017-11-14 12:40:17 -08:00
Guus der Kinderen
610a438dac Annotate Google SSLTCP hardcoded values.
This commit adds documentation only. It does not introduce functional changes.

The documentation was generated by crafting hex dumps from the values hardcoded
in the source code, which were fed to Wireshark (using its "import from hex dump"
option).
2017-11-13 14:59:33 -06:00
bbaldino
c26679744c Merge pull request #131 from bgrozev/revert-username-hack
Reverts feecacefc58e54e83bef527af5b4e058cdcc0403 (username attribute …
2017-08-21 10:35:37 -07:00
brian baldino
39403816f8 remove a transaction if a packet fails validation 2017-08-20 21:33:50 -05:00
Boris Grozev
4c5cc1642a Reverts feecacefc58e54e83bef527af5b4e058cdcc0403 (username attribute hack). 2017-08-18 23:19:25 -05:00
Boris Grozev
5188097479 fix: Does not close Multiplexing on Multiplexed.close()
Waits until all of the Multiplexed sockets belonging to a Multiplexing
are closed before closing the Multiplexing socket. Also introduces the
"persistent" flag of Multiplexing, which keeps it open even after all
of its Multiplexed sockets are closed.

fix: Makes MultiplexingDatagramSocket#persistent final.
2017-07-12 16:00:43 -05:00
Boris Grozev
f6e3deb9a5 feat: Adds another utility method. 2017-06-29 11:27:54 -05:00
Boris Grozev
ed26be48d7 fix: Uses the correct index. 2017-06-26 12:54:03 -05:00
Boris Grozev
feecacefc5 fix: Works around a bug in Edge
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12332457/
https://github.com/jitsi/lib-jitsi-meet/issues/498
2017-06-23 12:56:54 -05:00
Boris Grozev
b6e5d035e5 fix: Fixes a bug which prevents the socket to close.
After the delegate is closed, isClosed() would return true,
which would prevent the DatagramSocket instance (super) from
actually closing and releasing its resources.
2017-05-10 16:59:06 -05:00
damencho
e472f6ac1c Fixes leak of file descriptors by not closing DatagramSockets.
The problem was reproduced with java7 and defining multiple ipv6 fake(not-operational) addresses to one of the interfaces and running for a while.
Fixes jitsi/jitsi-meet#1390 and fixes jitsi/jicofo#167.
2017-05-10 15:06:15 -05:00
bgrozev
e099d4acbe Merge pull request #113 from imont/harvest-timeout
Introduce harvesting timeout option
2017-05-08 11:22:29 -05:00
Romanas Sonkinas
969e363bc6 Introduce harvesting timeout option 2017-04-28 17:28:44 +01:00
George Politis
f9eded5078 ref: Makes the single port recv buffer sysprop public. 2017-04-20 10:27:39 -05:00
Дамян Минков
b3c304146b Merge pull request #97 from bgrozev/minor-changes
Minor changes: fixes typos and removes duplicated code
2017-04-11 10:58:47 -05:00
Boris Grozev
a524e1b2c0 fix: Closes the MultiplexingDatagramSocket instances created by single-port UDP candidates. 2017-04-10 13:47:22 -05:00
Boris Grozev
5085b042bb fix: Closes the MultiplexingDatagramSocket held by a Component. 2017-04-10 13:46:48 -05:00
bbaldino
3784d5681b Merge pull request #107 from bgrozev/fix-101
Fix 101
2017-03-30 15:22:46 -07:00
bbaldino
7f3a3806ca Merge pull request #105 from bgrozev/fix-100
fix: Removes an unused, broken and misnamed method. Fixes #100.
2017-03-30 15:17:21 -07:00
Boris Grozev
4847672519 ref: Removes an unused an buggy method.
port*2 can be outside the [min, max] range (if min > 0).
2017-03-29 14:21:10 -05:00
Boris Grozev
183e115cf2 fix: Fixes an incorrect port range computation (#101). 2017-03-29 14:20:56 -05:00
Boris Grozev
9348af1624 fix: Fixes #102 (inexact port range validation). 2017-03-29 14:08:03 -05:00
Boris Grozev
02992ee8d1 fix: Removes an unused, broken and misnamed method. Fixes #100. 2017-03-29 14:00:42 -05:00
Boris Grozev
7a78b72d5b ref: Removes MuxServerSocketChannel#assertIsNotNull
Uses the equivalent Objects#requireNonNull instead.
2017-03-23 15:56:49 -05:00
Boris Grozev
6401fcd436 doc: Fixes typos 2017-03-22 13:56:55 -05:00
Boris Grozev
6bfe2ac5e5 feat: Allows adding sockets to an Agent late,
after the Agent has completed/terminated.
2017-02-24 09:34:55 -06:00
Boris Grozev
0f86b8797f feat: Handles pairs discovered late,
after the Agent has completed/terminated.
2017-02-24 09:31:23 -06:00
Boris Grozev
7c63d5202c fix: Propagates close() to the underlying DatagramSocket implementation
fixing a leak of fd's while the the objects waiting to be finalized.
2017-01-11 12:30:33 -06:00
Boris Grozev
e1338126fe fix: Fixes a failure to inherit the base's tcpType for peer-reflexing candidates. 2017-01-10 15:44:20 -06:00
Ingo Bauersachs
203ffbd92b Add unit test for changed address parsing 2017-01-07 13:41:42 +01:00
Ingo Bauersachs
383002efe2 Handle RFC2732 IPv6 addresses ([::1] or [::1%1]) 2017-01-07 13:31:04 +01:00
Boris Grozev
cf61003e5b fix: Fixes a failure to recognize consent
confirmation for TCP pairs.
2016-12-21 16:09:32 -06:00
Boris Grozev
0d769bb46d fix: Makes the keep alive strategy final. 2016-12-15 11:15:31 -06:00
Boris Grozev
19e86e3bc9 Revert "fix: Only allow setting the keep-alive strategy before the Agent is started."
This reverts commit abec6b79e564961575b3372a2ead52053dd3a67e.
2016-12-15 11:07:26 -06:00
Boris Grozev
a1796c9bfb style: Whitespace and braces. 2016-12-15 10:45:43 -06:00
Boris Grozev
abec6b79e5 fix: Only allow setting the keep-alive strategy before the Agent is started. 2016-12-15 10:44:57 -06:00
Boris Grozev
fe2b1a3239 style: Remove an unused import. 2016-12-13 16:26:19 -06:00
Boris Grozev
c46c1a2613 style: Remove unused imports. 2016-12-13 15:11:30 -06:00