How to get backchannel file descriptor

keens312 keens312 at hotmail.com
Wed Aug 20 07:29:55 PDT 2008


> keens312 wrote:
> >> keens312 wrote:
> >>> Hi Michael,
> >>>
> >>> In the filter for backchannel, I created a thread to keep reading feedback from printer...
> >>>
> >>> On OSX 10.5, CUPS has created backchannel FDs for USB and Network backends.
> >>>
> >>> The question is how to get the correct file descriptor in filter?
> >> Use the supplied API: cupsBackChannelRead.  The file descriptor itself
> >> is #3.
> >>
> >> --
> >> ______________________________________________________________________
> >> Michael R Sweet                        Senior Printing System Engineer
> >>
> > To support OSX 10.3.9, I don't use cupsBackChannelRead.
> >
> > I am going to use fixed FD #3 for backchannel, hoping this FD will never be changed.
>
> We have no plans to change it, but you shouldn't depend on that.
>
> Use weak linking and test for the availability of the function at
> run-time:
>
>      if (cupsBackChannelRead != NULL)
>        /* start read thread */
>
> --
> ______________________________________________________________________
> Michael R Sweet                        Senior Printing System Engineer
>
Hi Michael,

I created a thread for reading from backchannel in filter.
In the thread, there is a loop, keep pooling data from bc.
Async way to read data, is there some code I can reference in CUPS?
my impl might have bugs that missing some feedback data from bc.

Keene




More information about the cups-devel mailing list