• Hi Wilberforce,
    I can explain. I add more than one listener to the same event, because I am using modular code, where different part of the code are called independently : A module with a webserver that start listening when we connect, Another module that synchronize the internal clock with an sntp/http page when we connect, a module that save the current data remotely. I believe this is what the listeners are for. And I am removing them to spare memory, every callback holds its own code that take memory. If you have one giant callback doing everything, you cannot free the unnecessary code.

    Yes, I sure can use only one listener, that's the solution I mention, and I manage the callbacks myself, this way I can still have modules adding their listeners and removing them to free memory. But this is exactly what wifi.removeListener() was supposed to do.

  • Mon 2017.07.24

    @Polypod, have you solved the original removeListener() mystery or is there some doubt in the resolution you have settled with?

    While It is true that a listener can be connected to most objects as you so astutely described, after reading the online reference, I agree with @Wilberforce that it appears the WiFi connected object was meant to have a single listener.

    Polypod, if you are still wondering if you are at a sutiable solution, please post the entire code module as it now stands. This may provide
    others with clues that then could provide some insight. We all understand that you are taking a stab at a rather complex event model. I myself have had to post unfinished-unpolished intermediate segments and felt a bit uncomfortable waiting to arrive at a solution.

    "It is the answers, not the questions, that are embarrassing." Helen Suzman

    To those that are following along, is anyone able to post an example with multiple listeners or reference an online tutorial?

About

Avatar for Robin @Robin started