[sane-devel] Network protocol packet sizes

Dave Close dclose at anim.dreamworks.com
Fri Mar 15 18:52:10 GMT 2002


Oliver Rauch wrote:
>(I quote the full mail because it did not get into the SANE-DEVEL mailing
>list, please press "Reply all" to CC your mails also to the mailing list).

Oliver, I initially posted my question to the list and you replied
privately. I responded to you privately. If you had wanted the whole
discussion on the list, you should have started it that way. It does
not seem right to quote just our last exchange to the list, leaving
some of the context out, while chiding me for keeping it private.

>There is no relvant difference between the network backend and a
>local scanner backend. When you call sane_read to a local scanner
>backend the maximum amount of data you get is the maximum buffer size
>of the used stream (pipe=4096 bytes (for linux, may be different on
>other systems)). For the net backend you also get the maximum size
>of the used stream but in this case it is not a local pipe but a
>network stream with a block size of 1xxx bytes

You are generalizing incorrectly. The only valid statement here is
that sane_read() will not return more data than the maximum buffer
size specified on the call. I have a backend which will return up to
32K bytes on a single call if run locally.

>In general we have the oppisite situation implemented with
>blocking/non blocking mode (wait if not data is available or not).
>What you suggest is a function that waits although there is data
>available. This is very bad vor GUI frontends.

I have never suggested any kind of wait. I pointed out that the network
protocol requires that the true backend already have all the data for
a single block available before it can put a size at the beginning of
the transmission. The transmission then gets broken up by the network
and the net backend treats each piece as a separate block. There is no
delay involved if net were to collect all the pieces of a block together
before responding to a sane_read() call.
-- 
Dave Close                    Dreamworks SKG, Animation Technology
+1 818 695 6962               Glendale California 91201-3007
dclose at anim.dreamworks.com    http://www.dreamworks.com/




More information about the sane-devel mailing list