View Full Version : I am working on a network printer spooler project. How to queue print requests ?

01-11-2015, 10:01 AM
I am implementing a network spooler printer in C linux.

I would want to know how to queue different print requests coming from different clients to a multi threaded server and passing them onto a printer?

for example pseudo code:
thread1 is interacting with client1
client 1 sends a file
server creates a file and copies it their at its end
server then queues the file path in a queue for processing by the printer
client1 sends file1,server stores file1
client1 sends file2,server stores file2

queue: file1,file2
Printer retrieves file1 and then file2 and then goes into wait state until a new arrives.
Does the above make sense?linu

How to address each client individually from a multi-threaded server?

For example client[1], client[2] etc., How to assign ID's for each client?
Someone told me that you should use threadid as clientid, is this a right approach?
3.How to simulate a document being printed ?
Any help would be highly appreciated!

01-13-2015, 04:52 PM
What this have something to do with CUPS Programming?