Git Product home page Git Product logo

Comments (13)

eeFLis avatar eeFLis commented on June 27, 2024 1

Yes, it has now been running for several hours without any problems. I think it is OK. Thank you

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024 1

Find here:

https://github.com/u-blox/ubxlib/tree/preview_feature_sock_forget_rmea

...a preview branch of the proposed uSockForgetAll(). Let me know if it meets your expectations, or feel free to suggest any improvements.

from ubxlib.

eeFLis avatar eeFLis commented on June 27, 2024 1

looks good. thanks

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

Hi there. Yes, I think you are right, I had misinterpreted my own comment above uCellSockCleanup():

/** Clean-up. This function should be called when
* there is no socket activity, either locally or from
* the remote host, in order to free memory occupied
* by closed sockets.
*
* @param cellHandle the handle of the cellular instance.
*/
void uCellSockCleanup(uDeviceHandle_t cellHandle);

...to mean that all sockets had been closed, which happens to be how we use it in our test cases, but of course that's not what it says, it should clean-up only unused sockets-related resources.

Let me try to figure out why I didn't put this in uCellSockDeinit() in the first place.

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

You may find a proposed fix in a preview branch here:

https://github.com/u-blox/ubxlib/tree/preview_fix_sock_clean_up_rmea

This passes our testing, but so did the original code, so please give it some through checking at your end; I am now just removing all of the URCs in uCellSockDeinit(), just concerned that there was a [potentially thread-safety/race-condition related?] reason why I wasn't doing that before which I can no longer recall.

When you have confirmed that you are happy I will merge the change, push it out to master here and delete the preview branch some time after that.

from ubxlib.

eeFLis avatar eeFLis commented on June 27, 2024

Hi Rob

looks good thank you.

another question regarding socket celanup:
What do you think about having a function that forces the socketcleanup.
After the module has switched to PSM, we are sure that all sockets are closed.

The reason why we do not close the socket beforehand is that we do not know exactly when the module will switch to PSM.
However, data can still be received from the socket as long as the module has not switched to PSM.

The second reason is that uSockClose would wake up the module from power save for another 6 seconds.

from ubxlib.

philwareublox avatar philwareublox commented on June 27, 2024

Hi,

You are correct, when the module goes into PSM sockets are closed.
Waking up from PSM you must recreate the sockets and connect to the servers (TCP).

Regards,
Phil.

from ubxlib.

eeFLis avatar eeFLis commented on June 27, 2024

Hi
Thank you for your quick reply.

That's how we do it. But at some point the closed UDP sockets must be cleaned up in ubxlib.
Because the ubxlib does not recognise that the sockets were closed when the module switched to PSM.

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

Hmmm, yes, subtle. I was going to say that uSockDeinit() should do that but of course that would talk to the module, which you do not want.

So maybe uSockForgetAll()? This would only do a ubxlib-cleanup of socket resources, for all sockets, it would not deinitialise the sockets layer (i.e. URC handlers would remain loaded), it would not talk to the module at all. I would explain in the function header that the use-case for this is the returning-from-3GPP-sleep case.

from ubxlib.

eeFLis avatar eeFLis commented on June 27, 2024

Sounds good. That would help us

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

OK, I will do that as a separate change. Have you been able to test that the fix for the clean-up issue is good? If so I will get it reviewed and pushed back to master here.

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

Fix for issue that was the subject of the original post now pushed to 3335108 here. Will do the "uSockForgetAll()" change next and post a preview branch for that here.

from ubxlib.

RobMeades avatar RobMeades commented on June 27, 2024

The addition of uSockForgetAll() is now on master here, see commit 857e2a6. I will close this issue now [please feel free to re-open if there is more to discuss on this topic] and will delete the preview_fix_sock_clean_up_rmea and preview_feature_sock_forget_rmea preview branches some time next week.

from ubxlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.