Lightstreamer PCL (Portable Class Libraries) Client 3.0.0
LSClient.SubscribeItems Method

Subscribes to a set of items, which share the same schema and other subscription parameters. All item and field names are provided. This requires that a LiteralBasedProvider or equivalent Metadata Adapter is configured on the Server, in order to understand the request. 

The items are not collected as one table, but they are subscribed each in a different table. However, the items are subscribed alltogether with a single connection to the Server. The items unsubscription can be made either in a single operation (through UnsubscribeTables) or through independent unsubscribe operations. 

A fully-featured listener interface is provided. 

Subscribed items are identified to the listener both by position and by by name. If name information is used, then the same listener instance can be used across multiple calls to this method, as long as the involved items are always different. The method OnUnsubscrAll will not be called on the listener. 

If the request fails, no subscriptions have been performed. 

The method is blocking; it returns only after receiving the Server answer upon the request submission; in case a batch is open, this will happen only upon the execution of the batch. See OpenConnection for details on timeout settings.  


public: SubscribedTableKey[] SubscribeItems(ExtendedTableInfo items, IHandyTableListener listener);
public virtual SubscribedTableKey[] SubscribeItems(ExtendedTableInfo items, IHandyTableListener listener);
Visual Basic
Public virtual Function SubscribeItems(items As ExtendedTableInfo, listener As IHandyTableListener) As SubscribedTableKey()
ExtendedTableInfo items 
Contains the specification and request parameters of the items to subscribe to. The structure is the same as that used in SubscribeTable, but the items will not be subscribed to as a table. A copy of the object is stored internally.  
IHandyTableListener listener 
Receives notification of data updates and subscription termination.  

An array of handles to the subscribed tables, one for each item. The order of the handles reflects the order of the items in the item set description. The handles are needed for unsubscription.

if the connection is closed. 
in case of connection problems. 
in case of errors in the supplied parameters or in Server answer. In this case, some zombie subscriptions may remain in the Server. In normal conditions, this exception should never happen. 
in case the Server has refused the connection request because of the constraints imposed either by the Metadata Adapter or by Server configuration.