I asked a question on stackoverflow and already got valuable input from Claus 
Ibsen. But      I have doubt if what I am after is feasible.

I want to attach a self written program to a legacy application that is able to 
print to local host connected tcp printer. This can be simulated by using 
netcat and is ever more basic than lpr (for those interested: I am talking 
about Epson esc pos printers like Tm-T 88 which have an Ethernet interface)
In want to identify "Print Jobs" that means simply grabbing single bytes or 
lines is not enough. I need to know when a job was sent and when a new one 
starts. The testprogram I already created is not able to recognize this and 
receives the data in 1kb, 2kb, 4kb, ... packages.

The idea is to forward jobs to a jams queue and have it handled there. To make 
it even more difficult I have to intercept certain print job which simply 
consist of two bytes because they ask for the printers status. To simplify this 
I would not forward them to the queue and instead reply with a "everything is 
ok, you can print"

My two concerns are:
- is it possible to write a codec that detects the end of a print job ?
- how to implement the route that has a look at the print job before forwarding 
it to the queue ? 


Reply via email to