Once started, the daemon switches into waiting mode.
To use the daemon, a client application is required which sends recognition requests to a predefined daemon port.
This port is fixed in Engine distribution, but any experienced developer can change this so that the port becomes selectable or so that the program can to listen to several ports at the same time.
The distribution contains also a daemon client sample.
The second process (the copy) loads Engine, sets it up according to the request’s parameters, starts a recognition process, detects the end of the recognition process, and responds to the client with a result (success or failure). The client waits for a result all this time.
The daemon code ABBYY provides is a sample how FineReader Engine Linux can be used.
This sample demonstrates that it is possible to implement the service architecture based on the ABBYY Engine
It shows how to use ABBYY OCR technologies and it determines the current features and advantages.
-
Asynchronous tasking from different clients
Number of requests is not fixed
Interchange protocol is TCP/IP
Listens to port 7000, accepts requests from any client address
All features of Engine CLI in command line mode
Since the code is “just” a sample it might not be 100% production ready, since it is:
Tested only on a local client
Works with absolute file paths
Accepts only Engine CLI command lines
Returns only an exit code of success or error
Separates recognition into a detached process. Daemon itself is quite simple, so it’s very stable. A recognition error makes the child process stop whereas the parent process is continuing to handle the client’s requests.
Daemon can be started with more or fewer privileges than any user account has.
Client-server architecture. One service can process requests from several clients simultaneously.
Being a dispatcher for Engine, makes it possible to conceal the location of Engine from clients.
Daemon is exactly where recognition process service functions can be implemented, e.g.: queuing, workload balancing, audit, statistics gathering, and custom security options. Those are functions which aren’t implemented in Engine and shouldn’t be implemented on the client side.
You can compile your own executable daemon application with all the functionality you would like to have for this service, e.g. a daemon that exports searchable
PDF with one special call.
Engine distribution contains a Daemon sample.The sample includes:
The Daemon client is a CLI application. Its job is to send its command line parameters to Daemon using TCP/IP (address 127.0.0.1:7000) and to receive an exit code.
Back to: FineReader Engine for Linux Overview