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] zeroconf can't find new services after switch wifi #82

Open
seanyang1984 opened this issue Jul 11, 2019 · 2 comments
Open

[IOS] zeroconf can't find new services after switch wifi #82

seanyang1984 opened this issue Jul 11, 2019 · 2 comments

Comments

@seanyang1984
Copy link

seanyang1984 commented Jul 11, 2019

After switch wifi, the failure callback will be called.
After that the zeroconf can't find new services.

I have tried:
this.zf.watch('_http._tcp.', 'local.', (result) => {
}, (ec) => {
// After switch wifi, this failure callback will be called.
console.log("zf error: ",ec);
this.zf.reInit();
});

but it does't work

Steps to reproduce:

connect wifi1
start app
switch to wifi2
4.check app

@emcniece
Copy link
Collaborator

I'm curious if the Zeroconf network adapters are being disposed of properly when running reInit from inside the watch callback. Could you share some network info in various spots (ie. inside watch and inside ec) with a plugin like https://github.com/apache/cordova-plugin-network-information ?

@seanyang1984
Copy link
Author

I remove this.zf.reInit(), and add:

  this.network.onDisconnect().subscribe( () => {
    console.info('network was disconnected :-(');
  } );

  this.network.onchange().subscribe( () => {
    console.info('network was onchange :-(');
  });
  this.network.onConnect().subscribe( () => {
    console.info('network was onConnect :-(');
  });

but it only print: zf error: – null

onDisconnect, onConnect, onchange will be called on turn on or turn off wifi

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