I’m trying to do a GPRS + TCP/IP shutdown on a CGREG event, then restart.
What I’m finding is that the wip_bearerStop never completes, I get no WIP_BEV_STOPPED event and repeat calls to wip_bearerStop give WIP_BERR_OK_INPROGRESS.
If I call the shutdown process myself from a good network, it all ripples through the event chain OK
WIP_BEV_IP_DISCONNECTED (where I call wip_bearerStop )
WIP_BEV_STOPPED (where I call wip_bearerClose )
but it seems to get stuck from a network failure.
If I go ahead with a restart the wip_bearerOpen, returns all ready open, but the connection is not good.
Any clues? I’m tempted to just reset the whole thing, but its not very elegant.
I think you’re fighting WIP!
I think it tries to keep the bearer “up” until all its own internal retries & timeouts (or watever) have failed.
Therefore, you need to let WIP handle this: it will (should?) give an WIP_BEV_IP_DISCONNECTED event when it decides that all is lost - until then, leave it alone…
I get your drift, but I’m still waiting for the close 15 mins later.
In wip_bearerClose its says “If the bearer is not stopped the underlying connection is terminated but no
event is generated.” Doesn’t say don’t do it. However, on the same page is the error code “WIP_BERR_BAD_STATE Bearer was not stopped before closing”.
So should I try ignoring the stop and just close it if it doesn’t do it promptly?
EDIT: well, I’ve tried ignoring the Stop and issuing a wip_bearerClose, but the bearer will not re-open correctly then. I’ll see what support say.