-
Notifications
You must be signed in to change notification settings - Fork 24
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
Keep getting SocketException: Failed host lookup: 'ws://10.0.3.2:8080/websocket-example' (OS Error: No address associated with hostname, errno = 7) while trying to connect from an emulator #19
Comments
even using an online websocket url doesnt work }); |
Having the same issue. Are we doing something wrong?
|
I am having the same problem when I try to connect to my local IP. Has anyone been able to solve it? |
@Mikaulin no i havent |
For some reason the VM implementation is with Socket and that requires only an IP address and port and that setup does not work well with sprint. In order to solve this problem I've used https://pub.dartlang.org/packages/web_socket_channel as socket library. Here the example: For the authentication I'm fighting this problem dart-lang/web_socket_channel#41 and I'm not sure if it's in this library or the socket library. |
i'm having the same problem. anybody worked out where it's going wrong? |
Hey @xbassols, thanks for the workaround, it works great, since development for this plugin seems to be stopped, could you please fork the repo and include your changes there, it would really be helpful for everyone. Thanks again! |
DUDE, THANK YOU, IT FINALLY WORKS. I SPENT TWO DAYS TRYING TO USE THIS LIBRARY |
i am trying to connect to a socket via gennymotion emulator on my local box, using the gennymotion localbox ip of 10.0.3.32, here is my code bellow:
connect("ws://10.0.3.2:8080/websocket-example").then((StompClient client) {
});
but i keep getting the exception:
E/flutter ( 6573): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 6573): SocketException: Failed host lookup: 'ws://localhost:8080/websocket-example' (OS Error: No address associated with hostname, errno = 7)
E/flutter ( 6573): #0 _NativeSocket.lookup. (dart:io/runtime/binsocket_patch.dart:362:9)
E/flutter ( 6573): #1 _RootZone.runUnary (dart:async/zone.dart:1379:54)
E/flutter ( 6573): #2 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
E/flutter ( 6573): #3 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
E/flutter ( 6573): #4 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
E/flutter ( 6573): #5 Future._completeWithValue (dart:async/future_impl.dart:486:5)
E/flutter ( 6573): #6 Future._asyncComplete. (dart:async/future_impl.dart:516:7)
E/flutter ( 6573): #7 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 6573): #8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
why is this, and is this specific to emulator or am i calling the wrong tcp port
The text was updated successfully, but these errors were encountered: