lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Can you connect a MQTT client directly from a PPPoS sta


From: Sylvain Rochet
Subject: Re: [lwip-users] Can you connect a MQTT client directly from a PPPoS status callback?
Date: Thu, 16 May 2019 21:28:52 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Hi,

On Thu, May 16, 2019 at 07:51:45PM +0200, address@hidden wrote:
> Am 16.05.2019 um 18:31 schrieb Freddie Chopin:
> >Hello Devanand!
> >
> >On Thu, 2019-05-16 at 20:41 +0530, Devanand Biradar wrote:
> >>I have connected to mosquito cloud using Lwip via MQTT.
> >>Using PPPOS with GSM module.
> >
> >Yes, I know this can be done, because I already have done it and it
> >works (; But now I would like to make it more error-proof and
> >responsive - my code so far is just a dirty proof-of-concept using
> >stupid things like global flags and polling.
> >
> >So what I'm asking is this - is it safe to have code like this:
> 
> It's probably not safe as you risk calling back into modules that are
> not reentrant. I don't know this for sure, just as a saftey measurement...

Hummm, I guess it's safe, I doubt PPP status callback can actually be 
called from a module.

Looking at the code it can only be called:
  - Right from ppp_close(), only if the session is already dead;
  - If the lower level link failed to setup, i.e. timeout. in 
    ppp_link_failed();
  - If the link is shutting down, i.e. timeout or LCP "Term" packet
    received in ppp_link_end();
  - If the link is UP, after a packet is received, in sifup() and 
    sif6up().

Unless you are calling ppp_close() from a module, which I highly doubt, 
it is safe because other triggers are only rx packet or timeouts.

Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]