[sane-standard] sane standard proposals (1) "callbacks"

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 11 Oct 2004 18:20:31 +0200


Hi,

On Mon, Oct 11, 2004 at 02:40:38AM +0200, Johannes Berg wrote:
> 1. Network protocol and callbacks/buttons
> 
> The current standard asks for a frontend to always poll the backend for
> changed information, e.g. button presses.

That's the way SANE works at the moment (not only the network protocol). 

> What is the point here? Why could a reasonable RPC mechanism not allow
> messages that are unilaterally sent by the server, tagged with an
> appropriate code to signify what they mean.
> 
> I imagine (the standard isn't too clear on this, a few datagram diagrams
> could help)

The network part of the standard is indeed very brief. IIRC it doesn't
even contain the RPC numbers.

> that each message sent from and to the server is tagged with
> a code signifying what type of request/response it is, thus it should be
> possible to have the server unilaterally send a message of code "RESCAN"
> which would prompt the frontend to query the buttons status.

At least the current implementation doesn't have a way to do that. The
client just sends the PRC number and the options encoded as specified
in the standard. The server can't know when such an RPC is sent and
therefore there will be clashes when the server sends it's own RPC
while the client expects a response to his RPC.

I don't say it's not possible to do that by e.g. your proposal or by
using yet another port for the other direction. I'm just not sure if
it's a good idea.

But I'leave the network protocol for our network experts.

> The local frontend/backend communication would of course implement this
> with a trivial sane_callback_rescan() function.

To rescan all options? Depending on the kind of options that can
produce quite a lot of traffic. Maybe even more than polling for one
option.

Bye,
  Henning