Deveel.Data.Client.ConnectionClient.Connect C# (CSharp) Method

Connect() public method

public Connect ( ) : void
return void
        public void Connect()
        {
            if (Connector == null) {
                Connector = CreateConnector();
                Processor = Connector.CreateProcessor();
            }

            remoteEndPoint = MakeRemoteEndPoint();

            var request = new ConnectRequest(Connector.LocalEndPoint, remoteEndPoint) {
                DatabaseName = Settings.Database,
                Timeout = Settings.QueryTimeout,
                IgnoreIdentifiersCase = Settings.IgnoreIdentifiersCase,
                ParameterStyle = Settings.ParameterStyle,
                AutoCommit = Settings.AutoCommit
            };

            var response = SendMessage(request) as ConnectResponse;
            if (response == null)
                throw new ProtocolException("The returned message is invalid");

            if (!response.Opened)
                throw new DeveelDbServerException("Was not able to open the connection on the server.", -1, -1);

            if (response.IsEncryted)
                Connector.SetEncrypton(response.EncryptionData);

            IsClosed = false;
            ServerVersion = response.Version;
        }