Add an Event Subscription object to an Event Server.
Create an OPCEventSubcription object on behalf of this client and return an
interface to the Client.
This object will support at least IUnknown, IOPCEventSubscriptionMgt and
IConnectionPointContainer. The client can manage the state of this interface
including the filter and can create subscriptions to it via ConnectionPoints
as described later.
The Event Subscription Object uses conventional reference counting and thus
will be deleted with all interfaces to it are released.
Syntax
Parameters
- srv
- Object of the AE Server for which an EventSubscriptionMgt has to be created.
- Active
- FALSE if the Event Subscription is to be created inactive.
TRUE if the Event Subscriptions is to be created as active.
If the subscription is inactive, then the server will not send event notifications to the client based on the subscription, and has no responsibility to buffer or maintain the event notifications. Thus event notifications may be lost. - BufferTime
- The requested buffer time. The buffer time is in milliseconds and tells the server how often
to send event notifications.
This is a minimum time - do not send event notifications any faster that this UNLESS dwMaxSize is greater than 0,
in which case the server will send an event notification sooner to obey the dwMaxSize parameter. A value of 0 for
dwBufferTime means that the server should send event notifications as soon as it gets them. This parameter along with
the dwMaxSize parameter are used to improve communications efficiency between client and server. This parameter is a
recommendation from the client, and the server is allowed to ignore the parameter. The server will return the buffer
time it is actually providing in pdwRevisedBufferTime. If the revised buffer time does not equal the requested buffer
time, then the server must return OPC_S_INVALIDBUFFERTIME, unless dwMaxSize is also invalid in which case the server
must return OPC_S_INVALIDMAXSIZE.
- MaxSize
- The requested maximum number of events that will be sent in a single IOPCEventSink::OnEvent callback.
A value of 0 means that there is no limit to the number of events that will be sent in a single callback.
Note that a value of dwMaxSize greater than 0, may cause the server to call the OnEvent callback more frequently than
specified in the BufferTime parameter when a large number of events are being generated in order to limit the number
of events to the MaxSize. This parameter is a recommendation from the client and the server is allowed to ignore this parameter.
The server will return the actual number of events it is actually providing in pdwRevisedMaxSize. If the requested MaxSize does
not equal the revised MaxSize then the Server must return OPC_S_INVALIDMAXSIZE.
- ClientSubscription
- Client provided handle for this event subscription. This handle is passed back in the OnEvent
callback to identify the subscription object that is calling back. The client should assign a unique value of ClientSubscription
for each subscription object in order to detect the source of the callback information.
- RevisedBufferTime
- The buffer time that the server is actually providing, which may differ from dwBufferTime.
- RevisedMaxSize
- The maximum number of events that the server will actually be sending in a single OnAEevent callback,
which may differ from MaxSize.
Requirements
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2016, .NET 4.x
See Also