示例#1
0
 def _create_subscription(self, handler):
     params = ua.CreateSubscriptionParameters()
     params.RequestedPublishingInterval = 10
     params.RequestedLifetimeCount = 3000
     params.RequestedMaxKeepAliveCount = 10000
     params.MaxNotificationsPerPublish = 0
     params.PublishingEnabled = True
     params.Priority = 0
     return Subscription(self.iserver.isession, params, handler)
示例#2
0
 def create_subscription(self, period, handler):
     """
     Create a subscription.
     returns a Subscription object which allow
     to subscribe to events or data on server
     """
     params = ua.CreateSubscriptionParameters()
     params.RequestedPublishingInterval = period
     params.RequestedLifetimeCount = 3000
     params.RequestedMaxKeepAliveCount = 10000
     params.MaxNotificationsPerPublish = 0
     params.PublishingEnabled = True
     params.Priority = 0
     return Subscription(self.iserver.isession, params, handler)
示例#3
0
 def create_subscription(self, period, handler):
     """
     Create a subscription.
     returns a Subscription object which allow
     to subscribe to events or data on server
     handler argument is a class with data_change and/or event methods.
     These methods will be called when notfication from server are received.
     See example-client.py.
     Do not do expensive/slow or network operation from these methods 
     since they are called directly from receiving thread. This is a design choice,
     start another thread if you need to do such a thing.
     """
     params = ua.CreateSubscriptionParameters()
     params.RequestedPublishingInterval = period
     params.RequestedLifetimeCount = 3000
     params.RequestedMaxKeepAliveCount = 10000
     params.MaxNotificationsPerPublish = 4294967295
     params.PublishingEnabled = True
     params.Priority = 0
     return Subscription(self.bclient, params, handler)