Reconnect within MessageReceiver

This commit is contained in:
Fedor Indutny 2021-06-23 07:47:42 -07:00 committed by GitHub
parent 0ec23be91b
commit a6394e0c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 24 deletions

View file

@ -59,6 +59,7 @@ import {
} from '../textsecure.d';
import { SignalService as Proto } from '../protobuf';
import { ConnectTimeoutError } from './Errors';
import MessageSender from './SendMessage';
// TODO: remove once we move away from ArrayBuffers
@ -305,15 +306,7 @@ async function _connectSocket(
return new Promise((resolve, reject) => {
const timer = setTimeout(() => {
reject(
makeHTTPError(
'_connectSocket: Connection timed out',
-1,
{},
'Connection timed out',
stack
)
);
reject(new ConnectTimeoutError('Connection timed out'));
client.abort();
}, timeout);