A mechanism for servicing connections by disassociating processing resources from idle connections and monitoring the idle connections for activity is described. In one embodiment, a connection that is being serviced by a processing resource is disassociated from the processing resource when the connection is idle. The connection is handed to a poll manager for placement into one of several poll subsets. A poll thread associated with each poll subset is sends the poll subsets and poll requests to a poll adapter. The poll adapter uses the features of the operating system to monitor the connection for activity, such as by polling the connections to identify any pending events. The approach may be implemented on different operating systems by changing the poll adapter. The poll manager passes active connections to a work queue to wait for servicing. The present invention avoids wasting resources on connections that are idle.
A method and apparatus for an event handling mechanism are described. Under an embodiment of the invention, a method comprises setting a timer for a plurality of time intervals; calling a polling function at the end of each of the plurality of time intervals, the polling function being performed by a first processor; and if the polling function results in a positive result, processing the results of the polling function with a second processor.
To provide a bi-directional data connection via the Internet, even across firewalls and starting from a client which is not visible as a server on the Internet, a first connection request for establishing a first transmission channel is sent from a first data processing device of a client via a data connection to a server of an automation system. The server responds to the request using a second transmission channel. The data connection is thus kept open permanently, allowing data to be sent and received bi-directionally. The operations between the client and the server are temporally independent of each other by at least one data network, in particular, the Internet. To guarantee a temporally unlimited service life of a data connection, dummy data is transmitted, for example, at regular intervals from the server to the client, even if no useful data is present, to maintain at least one data connection.