mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-15 18:32:18 +00:00
Improve detection of websocket drained status.
Will now work when you lose and regain network. Also removes the unnecessary InitialMessageRetriever.
This commit is contained in:
@@ -132,8 +132,10 @@ public class SignalServiceMessagePipe {
|
||||
* {@link Optional#absent()} when an empty response is hit, which indicates the websocket is
|
||||
* empty.
|
||||
*
|
||||
* Important: The empty response will only be hit once for each instance of {@link SignalServiceMessagePipe}.
|
||||
* That means subsequent calls will block until an envelope is available.
|
||||
* Important: The empty response will only be hit once for each connection. That means if you get
|
||||
* an empty response and call readOrEmpty() again on the same instance, you will not get an empty
|
||||
* response, and instead will block until you get an actual message. This will, however, reset if
|
||||
* connection breaks (if, for instance, you lose and regain network).
|
||||
*/
|
||||
public Optional<SignalServiceEnvelope> readOrEmpty(long timeout, TimeUnit unit, MessagePipeCallback callback)
|
||||
throws TimeoutException, IOException, InvalidVersionException
|
||||
|
||||
@@ -150,6 +150,8 @@ public class WebSocketConnection extends WebSocketListener {
|
||||
keepAliveSender.shutdown();
|
||||
keepAliveSender = null;
|
||||
}
|
||||
|
||||
notifyAll();
|
||||
}
|
||||
|
||||
public synchronized WebSocketRequestMessage readRequest(long timeoutMillis)
|
||||
|
||||
Reference in New Issue
Block a user