Esempio n. 1
0
 /// <summary>
 /// Creates the new connection
 /// </summary>
 /// <remarks>
 ///     Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection,
 /// NativeRegionalBook, NativeSnapshotSubscription classes
 /// </remarks>
 /// <param name="address">The server address to connect</param>
 /// <param name="disconnectListener">The listener that will be called when the connection is interrupted</param>
 /// <exception cref="DxException"></exception>
 public NativeConnection(string address, Action <IDxConnection> disconnectListener)
 {
     this.terminationNotifier           = OnDisconnect;
     this.connectionStatusChangeHandler = ConnectionStatusChangeHandler;
     this.creationNotifier   = OnNativeCreate;
     this.disconnectListener = disconnectListener;
     C.CheckOk(C.Instance.dxf_create_connection(address, terminationNotifier, connectionStatusChangeHandler,
                                                null, null, IntPtr.Zero, out handle));
 }
Esempio n. 2
0
 /// <summary>
 /// Creates the new connection.
 /// </summary>
 /// <remarks>
 ///     Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection,
 /// NativeRegionalBook, NativeSnapshotSubscription classes
 /// </remarks>
 /// <param name="address">The server address to connect.</param>
 /// <param name="credential">The user name and password to server access.</param>
 /// <param name="disconnectListener">The listener that will be called when the connection is interrupted.</param>
 /// <param name="connectionStatusListener">The listener that will be called when the connection status is changed</param>
 /// <exception cref="DxException">The connection creation was failed.</exception>
 public NativeConnection(string address, System.Net.NetworkCredential credential,
                         Action <IDxConnection> disconnectListener,
                         Action <IDxConnection, ConnectionStatus, ConnectionStatus> connectionStatusListener)
 {
     this.terminationNotifier           = OnDisconnect;
     this.connectionStatusChangeHandler = ConnectionStatusChangeHandler;
     this.disconnectListener            = disconnectListener;
     this.connectionStatusListener      = connectionStatusListener;
     C.CheckOk(C.Instance.dxf_create_connection_auth_basic(address, credential.UserName, credential.Password,
                                                           terminationNotifier, connectionStatusChangeHandler, null, null, IntPtr.Zero, out handle));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates new connection.
 /// </summary>
 /// <param name="address">Server address to connect.</param>
 /// <param name="token">Bearer scheme token to server access.</param>
 /// <param name="disconnectListener">Listener will be called when the connection is interrupted.</param>
 /// <param name="connectionStatusListener">listener will be called when the connection status is changed</param>
 /// <exception cref="DxException">Create connection failed.</exception>
 public NativeConnection(string address, string token, Action <IDxConnection> disconnectListener,
                         Action <IDxConnection, ConnectionStatus, ConnectionStatus> connectionStatusListener)
 {
     this.termination_notifier          = OnDisconnect;
     this.connectionStatusChangeHandler = ConnectionStatusChangeHandler;
     this.disconnectListener            = disconnectListener;
     this.connectionStatusListener      = connectionStatusListener;
     C.CheckOk(C.Instance.dxf_create_connection_auth_bearer(address, token, termination_notifier,
                                                            connectionStatusChangeHandler, null, null,
                                                            IntPtr.Zero, out handler));
 }
Esempio n. 4
0
 /// <summary>
 /// Creates the new connection.
 /// </summary>
 /// <remarks>
 ///     Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection,
 /// NativeRegionalBook, NativeSnapshotSubscription classes
 /// </remarks>
 /// <param name="address">The server address to connect.</param>
 /// <param name="authScheme">The authorization scheme.</param>
 /// <param name="authData">The authorization data.</param>
 /// <param name="disconnectListener">The listener that will be called when the connection is interrupted.</param>
 /// <param name="connectionStatusListener">The listener that will be called when the connection status is changed</param>
 /// <exception cref="DxException">The connection creation was failed.</exception>
 public NativeConnection(string address, string authScheme, string authData,
                         Action <IDxConnection> disconnectListener,
                         Action <IDxConnection, ConnectionStatus, ConnectionStatus> connectionStatusListener)
 {
     this.terminationNotifier           = OnDisconnect;
     this.connectionStatusChangeHandler = ConnectionStatusChangeHandler;
     this.disconnectListener            = disconnectListener;
     this.connectionStatusListener      = connectionStatusListener;
     C.CheckOk(C.Instance.dxf_create_connection_auth_custom(address, authScheme, authData, terminationNotifier,
                                                            connectionStatusChangeHandler,
                                                            null, null, IntPtr.Zero, out handle));
 }