File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/org/java_websocket/client Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,21 @@ public boolean reconnectBlocking() throws InterruptedException {
327327 return connectBlocking ();
328328 }
329329
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+ * @since 1.6.1
339+ */
340+ public boolean reconnectBlocking (long timeout , TimeUnit timeUnit ) throws InterruptedException {
341+ reset ();
342+ return connectBlocking (timeout , timeUnit );
343+ }
344+
330345 /**
331346 * Reset everything relevant to allow a reconnect
332347 *
You can’t perform that action at this time.
0 commit comments