kerimamansaryyev / dart_pusher_channels

MIT License
44 stars 11 forks source link

my host are edited while connecting (OS Error: No address associated with hostname, errno = 7) #49

Closed amdkholil closed 2 weeks ago

amdkholil commented 1 month ago

hallo @kerimamansaryyev

there is something strange when I use this plugin, I try to connect using the host homedev.dtp.net.id but an error appears that hostdev.dtp.id is not found. yes the host changes from homedev.dtp.net.id to homedev.dtp.id. what happen?

this is my code:

const testOptions = PusherChannelsOptions.fromHost(
      scheme: 'ws',
      host: 'homedev.dtp.net.id',
      key: 'mykeyxxxxxxxxxxxxxxxx',
      // port: 443,
    );

    client = PusherChannelsClient.websocket(
      options: testOptions,
      connectionErrorHandler: (exception, trace, refresh) async {
        print(exception);
        print(trace);
        refresh();
      },
    );

    unawaited(client.connect());

and this is error appear:

I/flutter (13970): Current lifecycle state: PusherChannelsClientLifeCycleState.pendingConnection
D/EGL_emulation(13970): app_time_stats: avg=209.96ms min=4.21ms max=875.01ms count=5
I/flutter (13970): Current lifecycle state: PusherChannelsClientLifeCycleState.connectionError
I/flutter (13970): SocketException: Failed host lookup: 'homedev.dtp.id' (OS Error: No address associated with hostname, errno = 7)
I/flutter (13970): #0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:721:35)
I/flutter (13970): #1      _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1914:26)
I/flutter (13970): #2      RawSocket.startConnect (dart:io-patch/socket_patch.dart:27:23)
I/flutter (13970): #3      RawSecureSocket.startConnect (dart:io/secure_socket.dart:299:22)
I/flutter (13970): #4      SecureSocket.startConnect (dart:io/secure_socket.dart:77:28)
I/flutter (13970): #5      _ConnectionTarget.connect (dart:_http/http_impl.dart:2480:26)
I/flutter (13970): #6      _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2923:12)
I/flutter (13970): #7      _HttpClient._getConnection (dart:_http/http_impl.dart:2928:12)
I/flutter (13970): #8      _HttpClient._openUrl (dart:_http/http_impl.dart:2783:12)
I/flutter (13970): #9      _HttpClient._openUrlFromRequest (dart:_http/http_impl.dart:2834:12)
I/flutter (13970): #10     _HttpClientResponse.redirect (dart:_http/http_impl.dart:678:10)
I/flutter (13970): #11     _HttpClientRequest._onIncoming.<anonymous closure> (dart:_http/http_impl.dart:1487:55)
I/flutter (13970): #12     _rootRunUnary (dart:async/zone.dart:1407:47)
I/flutter (13970): #13     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
I/flutter (13970): <asynchronous suspe
I/flutter (13970): Current lifecycle state: PusherChannelsClientLifeCycleState.reconnecting
kerimamansaryyev commented 4 weeks ago

I will have a look today. Firstly, check if there are any redirects on your original domain