c++socketsprintingtcpintel-ipp

IPP or JetDirect server implementation


I'm looking for a possibility to send some vector data to my application without the need to use external files with all their problems. So my idea was to implement a IPP or JetDirect print server in my application in order to receive plain (post script?) data from the sending application which then only needs to print the data to be exported.

Unfortunately I failed with some very first steps. To see what is going on I created a TCP server socket in my application listening on port 631 (and 9100 alternatively).

Next I went to Windows' printer driver configuration, clicked "Add new printer", selected TCP/IP network printer and configured IP 127.0.0.1 plus the related port number.

Now Windows started searching ... and did not found anything - and in my server application I could not see a connect from Windows. When using Putty to connect to my small server, everything works smoothly, I can see the incoming connection.

So: what could be wrong here? Does Windows have a specific understanding of what "TCP/IP" is? Or why can't I see Windows connecting to this server?

Or: is there a (free) C/C++ IPP or JetDirect printer server already available which could be used in my project?

Thanks!


Solution

  • It doesn't find any because you didn't announce the print service using ws-discovery.

    The easiest way is to use LPR protocol - you have to configure LPR in print port. The default port is 515.

    If you want to use IPP, you need to enable it in system features and then you can manually enter the IP address and port when adding the printer. Or, you can register _ipp._tcp using Bonjour and add the print using Bonjour printer wizzard.