Exemplo n.º 1
0
        public static IEventStoreConnection DefaultTCP()
        {
            var settings = ConnectionSettings.Create()
                           .KeepReconnecting()
                           .UseConsoleLogger();

            var connection = EventStoreConnection.Create(settings, IPEndPointFactory.DefaultTcp());

            connection.ConnectAsync();
            return(connection);
        }
Exemplo n.º 2
0
        public static IEventStoreConnection Connect(ConnectionSettingsBuilder connectionSettingsBuilder, EventStoreConfiguration config, string port, string connectionName = null)
        {
            connectionSettingsBuilder
            .UseConsoleLogger()
            .SetDefaultUserCredentials(EventStoreCredentials.Config(config));
            var endPoint   = IPEndPointFactory.CreateIPEndPoint(config.HostName, port);
            var connection = EventStoreConnection.Create(connectionSettingsBuilder, endPoint, connectionName);

            connection.ConnectAsync();
            return(connection);
        }