Skip to content

Commit bc99696

Browse files
authored
Fix app was crashed on socket timeout (#2352)
1 parent a683331 commit bc99696

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/lib/services/sockets/pure_socket.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class PureSocket implements IPureSocket {
122122
'Authorization': await getAuthHeader(),
123123
},
124124
pingInterval: const Duration(seconds: 20),
125-
connectTimeout: const Duration(seconds: 30),
125+
connectTimeout: const Duration(seconds: 10),
126126
);
127127
if (_channel?.ready == null) {
128128
return false;
@@ -132,6 +132,8 @@ class PureSocket implements IPureSocket {
132132
dynamic err;
133133
try {
134134
await channel.ready;
135+
} on TimeoutException catch (e) {
136+
err = e;
135137
} on SocketException catch (e) {
136138
err = e;
137139
} on WebSocketChannelException catch (e) {

0 commit comments

Comments
 (0)