We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c69b298 commit 611d897Copy full SHA for 611d897
1 file changed
src/main/java/org/java_websocket/client/WebSocketClient.java
@@ -327,6 +327,20 @@ public boolean reconnectBlocking() throws InterruptedException {
327
return connectBlocking();
328
}
329
330
+ /**
331
+ * Same as <code>reconnect</code> but blocks with a timeout until the websocket connected or failed
332
+ * to do so.<br>
333
+ *
334
+ * @param timeout The connect timeout
335
+ * @param timeUnit The timeout time unit
336
+ * @return Returns whether it succeeded or not.
337
+ * @throws InterruptedException Thrown when the threads get interrupted
338
+ */
339
+ public boolean reconnectBlocking(long timeout, TimeUnit timeUnit) throws InterruptedException {
340
+ reset();
341
+ return connectBlocking(timeout, timeUnit);
342
+ }
343
+
344
/**
345
* Reset everything relevant to allow a reconnect
346
*
0 commit comments