Skip to content

Add reconnectBlocking method with timeout#1251

Closed
sfeilmeier wants to merge 3 commits intoTooTallNate:masterfrom
sfeilmeier:feature/reconnect-with-timeout
Closed

Add reconnectBlocking method with timeout#1251
sfeilmeier wants to merge 3 commits intoTooTallNate:masterfrom
sfeilmeier:feature/reconnect-with-timeout

Conversation

@sfeilmeier
Copy link

Description

Add reconnectBlocking(long timeout, TimeUnit timeUnit) method similarly to the existing connectBlocking(long timeout, TimeUnit timeUnit) method.

Related Issue

none

Motivation and Context

In certain (non-reproduable) situations it seems the current reconnectBlocking method does neither finish nor abort. The idea here is to use the same approach with connectLatch as is already existing with the connectBlocking method.

How Has This Been Tested?

does not apply

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PhilipRoman
Copy link
Collaborator

PhilipRoman commented Jun 15, 2022

It's up to @marci4 to decide, but in any case, the current version is 1.5.3 so the javadoc comment should have @since 1.5.4 instead of 1.3.8

@marci4
Copy link
Collaborator

marci4 commented Jul 4, 2022

I would really prefer a issue to test than another api.

@marci4 marci4 closed this Dec 26, 2022
lukasrgr pushed a commit to OpenEMS/openems that referenced this pull request May 24, 2023
`WebSocketClient#reset()` method may block on `closeLatch.await();`. This PR rewrites the entire method via Reflection to be able to call `closeLatch.await(CONNECT_TIMEOUT_SECONDS, TimeUnit.SECONDS);` instead.

Ideally this should be solved upstream in TooTallNate/Java-WebSocket#1251. Somehow related issue: TooTallNate/Java-WebSocket#1236

Co-authored-by: Michael Grill <michael.grill@fenecon.de>
Reviewed-on: https://git.intranet.fenecon.de/FENECON/fems/pulls/437
Reviewed-by: Michael Grill <michael.grill@fenecon.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants