<div dir="ltr">On Fri, Jul 11, 2014 at 1:47 PM, Greg Suarez <span dir="ltr"><<a href="mailto:gpsuarez2512@gmail.com" target="_blank">gpsuarez2512@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div><div class="h5">On Fri, Jul 11, 2014 at 6:51 AM, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br>
</div></div><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Fri, Jul 11, 2014 at 1:42 PM, Bjørn Mork <<a href="mailto:bjorn@mork.no" target="_blank">bjorn@mork.no</a>> wrote:<br>
>> One thing we didn't think about is how the mbim-proxy should handle<br>
>> --no-open or --no-close actions performed by the mbimcli command line<br>
>> interface.<br>
>><br>
>> * When the --no-close option is used by mbimcli, it won't send a last<br>
>> MBIM Close request to the modem before exiting.<br>
>><br>
>> * When the --no-open is used by mbimcli, it won't send an initial<br>
>> MBIM Open request to the modem when starting (e.g. if --no-close was<br>
>> used in the previous action).<br>
>><br>
>> Now, when using the proxy, it will send an explicit MBIM Close request<br>
>> to the device when all clients have been disconnected from the proxy,<br>
>> which prevents the usage of --no-close. How can we best handle this<br>
>> situation?<br>
>><br>
>> One option would be to let the proxy keep an 'open count' value,<br>
>> depending on the open/close requests coming from the clients, and only<br>
>> if the open count drops to zero it will send the MBIM close. One<br>
>> problem with this approach is that if e.g. we get ModemManager<br>
>> segfault unexpectedly it won't send the MBIM close, so an<br>
>> open-reference will be lost. Not sure if this is a big issue, though.<br>
>><br>
>> What do people think?<br>
><br>
> I don't think there is any way you can make CLOSE work with the proxy,<br>
> so you might as well just do an OPEN when the proxy starts and a CLOSE<br>
> when it exits.<br>
><br>
> The only reason a client has to close a session is to ensure that the<br>
> modem is reset to some default initial state. This is impossible to<br>
> gurarantee with the proxy, because other clients may depend on the<br>
> current state. IMHO it is better to make the behaviour predictable by<br>
> never honouring a CLOSE request than to implement some scheme to allow<br>
> the last client to issue a real CLOSE.<br>
><br>
> And it is easier as well :-) No reference counter and no problems with<br>
> crashing clients.<br>
<br>
</div></div>That is indeed a good approach... and much easier. Greg, what do you think?<span><font color="#888888"><br></font></span></blockquote><div><br></div></div></div><div>That sounds good, but we would have to modify the proxy so that it doesn't exit<br>
if there are no clients connected. </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">
<span style="color:rgb(34,34,34)"> </span></div></font></span></div></blockquote><div>So I think I'm going to change the logic to have the proxy exit 30 seconds after the</div><div>last modem has been removed instead of the last connected client.</div>
<div>Does that sound good to you guys?</div><div><br></div><div>Greg </div></div></div></div>