dint-dev / universal_io

Cross-platform 'dart:io', including browser-compatible HttpClient.
https://pub.dev/packages/universal_io
Apache License 2.0
97 stars 11 forks source link

InternetAddress.lookup produce an error on web #21

Open alihabbash opened 3 years ago

alihabbash commented 3 years ago

I use the method InternetAddress.lookup from the ConnectionStatusHandler.checkConnection method on the web and it's producing an unimplemented error and it happens both when I have and when I don't have internet connection here is the full log:

Error: UnimplementedError
    at Object.throw_ [as throw] (http://localhost:11909/dart_sdk.js:5334:11)
    at Function.lookup (http://localhost:11909/packages/universal_io/src/io/sync_socket.dart.lib.js:3085:24)
    at connection_status_handler.ConnectionStatusHandler._internal.checkConnection (http://localhost:11909/packages/flutter_app/util/connection_status_handler.dart.lib.js:119:64)
    at checkConnection.next (<anonymous>)
    at runBody (http://localhost:11909/dart_sdk.js:39052:34)
    at Object._async [as async] (http://localhost:11909/dart_sdk.js:39083:7)
    at connection_status_handler.ConnectionStatusHandler._internal.checkConnection (http://localhost:11909/packages/flutter_app/util/connection_status_handler.dart.lib.js:116:20)
    at connection_status_handler.ConnectionStatusHandler._internal.initialize (http://localhost:11909/packages/flutter_app/util/connection_status_handler.dart.lib.js:90:12)
    at main$ (http://localhost:11909/packages/flutter_app/game_server/socket_handler.dart.lib.js:196625:24)
    at main$.next (<anonymous>)
    at http://localhost:11909/dart_sdk.js:39032:33
    at _RootZone.runUnary (http://localhost:11909/dart_sdk.js:38889:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:11909/dart_sdk.js:33875:29)
    at handleValueCallback (http://localhost:11909/dart_sdk.js:34435:49)
    at Function._propagateToListeners (http://localhost:11909/dart_sdk.js:34473:17)
    at _Future.new.[_completeWithValue] (http://localhost:11909/dart_sdk.js:34315:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:11909/dart_sdk.js:34338:35)
    at Object._microtaskLoop (http://localhost:11909/dart_sdk.js:39176:13)
    at _startMicrotaskLoop (http://localhost:11909/dart_sdk.js:39182:13)
    at http://localhost:11909/dart_sdk.js:34689:9
menezes85 commented 3 years ago

I have exactly the same problem, not working on web.

SeriousMonk commented 3 years ago

same, seems this function is not implemented on web