The server must furthermore be able to maintain concurrent client connections. This way, one long operation does not lead to the starvation of others. Moreover, OPC requests may contain multiple requests in one message. For instance, one ReadRequest message may request multiple items at once. Furthermore OPC requests may contain a so-called ``Deadline'' which specifies how long a single item request may last. Therefore handling messages with multiple requests by issuing sequential ESD commands are inappropriate, as a long-lasting command may lead to the starvation of others.
Figure 63 shows two possible solutions to this problem. The left diagram solves the problem by issuing one ESD command per requested item, while the right diagram implements a connection pool which maintains multiple open connections to the ESD server.
In this implementation, the solution in the left diagram will be chosen. The simple reason for this is simplicity, as setting up and maintaining a connection pool may lead to a high level of complexity. The disadvantage is that many concurrent client connections may thus lead to a high memory requirement in the OPC server and high loads on the ESD server136.
Basically there are three methods to maintain concurrency in a server:
Each of these concepts has its strength and weaknesses. For this design, an event-driven concept seems most appropriate for the following reasons:
The disadvantage of an event-driven design is that it does not make sense where computing-intensive tasks should be parallelized. Moreover, the design has to be asynchronous from the beginning. Therefore existing blocking functions cannot be parallelized later. However, these two disadvantages are not important for this design, as computing-intensive functions do not exist and the OPC server will be modeled with the event-driven concept in mind from the beginning.
ZSI does not support concurrent programming very well. It offers dispatching of SOAP methods in a CGI-like style, however this is inappropriate for this design as a CGI-program needs a separate web server. It also provides a simple HTTP server, with very limited functionality. However, all dispatching is based on the top-level SOAP element and can therefore not be used for OPC XML-DA.