Visual Basic (Usage) | ![]() |
---|---|
Dim instance As Session Dim name As String Dim publishingInterval As Integer Dim priority As Byte Dim enabled As Boolean Dim keepAliveCount As UInteger Dim lifetimeCount As UInteger Dim callback As AsyncCallback Dim userData As Object Dim value As IAsyncResult value = instance.BeginAddSubscription(name, publishingInterval, priority, enabled, keepAliveCount, lifetimeCount, callback, userData) |
C# | |
---|---|
public IAsyncResult BeginAddSubscription( string name, int publishingInterval, byte priority, bool enabled, uint keepAliveCount, uint lifetimeCount, AsyncCallback callback, object userData ) |
Parameters
- name
- The display name of the subscription.
- publishingInterval
- This interval defines the cyclic rate that the Subscription is being requested to return Notifications to the Client. This interval is expressed in milliseconds. This interval is represented by the publishing timer in the Subscription state table. The negotiated value for this parameter returned in the response is used as the default sampling interval for MonitoredItems assigned to this Subscription. If the requested value is 0 or negative, the server shall revise with the fastest supported publishing interval.
- priority
- ndicates the relative priority of the Subscription. When more than one Subscription needs to send Notifications, the Server should de-queue a Publish request to the Subscription with the highest priority number. For Subscriptions with equal priority the Server should de-queue Publish requests in a round-robin fashion. A Client that does not require special priority settings should set this value to zero.
- enabled
- A Boolean parameter with the following values:
TRUE publishing is enabled for the Subscription.
FALSE publishing is disabled for the Subscription.
The value of this parameter does not affect the value of the monitoring mode Attribute of MonitoredItems. - keepAliveCount
- Requested maximum keep-alive count. When the publishing timer has expired this number of times without requiring any NotificationMessage to be sent, the Subscription sends a keep-alive Message to the Client. The negotiated value for this parameter is returned in the response. If the requested value is 0, the server shall revise with the smallest supported keep-alive count.
- lifetimeCount
- Requested lifetime count. The lifetime count shall be a minimum of three times the keep keep-alive count. When the publishing timer has expired this number of times without a Publish request being available to send a NotificationMessage, then the Subscription shall be deleted by the Server.
- callback
- The callback to use when the async call completes.
- userData
- The user data that is passed to the callback.
Return Value
An object which must be passed to the EndAddSubscription method.Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x