Hi, I’m currently working on UNET NetworkTransport BroadcastDiscovery.
I’m using a modified version of this example.
However, if I call StopBroadcastDiscovery() and ask for NetworkTransport.IsBroadcastDiscoveryRunning() immediately afterwards, true is being returned.
Is this an asynchronous call?
If so, how can I get notified about the Discovery having finished the stopping process?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Also, is it possible to change the broadcast data while the service is running?
I tried the following:
- Stop()
- Change msgBuffer
- Start()
, but this resulted in the following error:
Broadcast discovery has been already running. Stop discovery first before repeat this call
Looks like this has also to do with my first question (see above).
edit:
Yep, Start and Stop seem to be asynchronous. If I waitForSeconds between the Stop() and Start() call, it works as expected. However, waitForSeconds is a dirty hack.
I still would like to know, if I can change the broadcasting data without restarting the service and / or if and how I can listen for Stop() to be finished.
Cheers,
phineliner