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

IOS manually turn off cellular data, it takes a long time to trigger onDone #207

Open
cookie-session opened this issue Jan 4, 2022 · 3 comments

Comments

@cookie-session
Copy link

@OverRide
void initState() {
super.initState();
_webSocket = IOWebSocketChannel.connect("ws://xxxxxx");
_webSocket!.stream.listen((data){
debugPrint(data);
}, onError: (e){
WebSocketChannelException ex = e;
debugPrint('---ex------${ex.message}');
}, onDone: (){
//IOS trigger has a delay of more than a few minutes
//Android everything is ok
debugPrint("2222");
});
}

@cookie-session
Copy link
Author

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6.1 20G224 darwin-x64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] Connected device (2 available)

@luckiers
Copy link

luckiers commented May 6, 2022

try pingInterval

@GoodMorrrrning
Copy link

How can we use pingInterval with WebSocketChannel ?
i have this :

WebSocketChannel channel = WebSocketChannel.connect(
   Uri.parse('ws://chat.something.fr'), 
 );

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

3 participants