Lightstreamer .Net Standard Client 4.0.0
LSClient.OpenConnection Method

Opens a connection to the Server with the supplied parameters. More precisely, the Server will initiate a push session for this client, which will be accessed through a streaming connection or through a train of polling connections, depending on the configuration parameters. If a connection is already open, it is closed first. 

If streaming (as opposed to polling) is specified in the connection parameters and the environment does not allow HTTP streaming, then the "Stream-sense" feature, if enabled, is activated; hence, if the streaming connection has not yielded any data after a few seconds, a polling connection is tried instead. 

The method is blocking; it returns only after a connection to the Server has been established or the attempt has failed. It is possible to enforce timeouts for the socket connection task and for any further read task by setting the ConnectTimeoutMillis and ReadTimeoutMillis properties of ConnectionInfo

Edition Note: Connections from the .NET Client Library is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please see the License tab of the Monitoring Dashboard (by default, available at /dashboard). 


public: void OpenConnection(ConnectionInfo info, IConnectionListener listener);
public virtual void OpenConnection(ConnectionInfo info, IConnectionListener listener);
Visual Basic
Public virtual Function OpenConnection(info As ConnectionInfo, listener As IConnectionListener) As void
ConnectionInfo info 
Contains the Server address and the connection parameters. A copy of the object is stored internally. 
IConnectionListener listener 
Receives notification for connection events.  
in case of connection problems. 
in case of errors in the supplied parameters or in Server answer. In normal operation, this should not happen. 
in case the Server has refused the connection request because of the constraints imposed either by the Metadata Adapter or by Server configuration.