Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem occurred when using web socket and loosing internet #13

Closed
benoit-rolandeau-act opened this issue Jun 15, 2023 · 1 comment
Closed

Comments

@benoit-rolandeau-act
Copy link

When listening telemetries and attributes update via the WebSocket. If we loose internet, the following exception happens and can't be managed:

#0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:719:35)
#1      _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1877:26)
#2      RawSocket.startConnect (dart:io-patch/socket_patch.dart:27:23)
#3      RawSecureSocket.startConnect (dart:io/secure_socket.dart:297:22)
#4      SecureSocket.startConnect (dart:io/secure_socket.dart:77:28)
#5      _ConnectionTarget.connect (dart:_http/http_impl.dart:2482:26)
#6      _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2924:12)
#7      _HttpClient._getConnection (dart:_http/http_impl.dart:2929:12)
#8      _HttpClient._openUrl (dart:_http/http_impl.dart:2784:12)
#9      _HttpClient.openUrl (dart:_http/http_impl.dart:2622:7)
#10     _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1021:42)
#11     WebSocket.connect (dart:_http/websocket.dart:320:22)
#12     new IOWebSocketChannel.connect (package:web_socket_channel/io.dart:81:28)
#13     connect (package:web_socket_channel/src/_connect_io.dart:15:24)
#14     new WebSocketChannel.connect (package:web_socket_channel/src/channel.dart:115:16)
#15     TelemetryWebsocketService._openSocket (package:thingsboard_client/src/service/telemetry_websocket_service.dart:204:38)
#16     TelemetryWebsocketService._tryOpenSocket (package:thingsboard_client/src/service/telemetry_websocket_service.dart:184:11)
#17     TelemetryWebsocketService._onClose.<anonymous closure> (package:thingsboard_client/src/service/telemetry_websocket_service.dart:292:61)
#18     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#19     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#20     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#21     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

The problem seems to come from the lib you use: WebSocketChannel, as you can see here: dart-lang/web_socket_channel#268

The solution suggested is the following one: flutter/website#8765 (comment)

@ikulikov
Copy link
Member

Fixed in ver. 1.0.8. Commit de8aff6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants