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