Exemplo n.º 1
0
 public LeClient(
     string address,
     int port,
     X509Certificate2 sslCertificate = null,
     Guid? token = null,
     LeMessageFormatter formatter = null)
     : this(new TcpConnection(address, port, sslCertificate), token, formatter)
 {
 }
Exemplo n.º 2
0
 public LeClient(
     TcpConnection connection,
     Guid? token = null,
     LeMessageFormatter formatter = null)
 {
     this.connection = connection;
     this.formatter = formatter ?? new LeMessageFormatter();
     this.tokenString = token != null ? token.ToString() : string.Empty;
 }
Exemplo n.º 3
0
 public LeClient(
     string address,
     int port,
     X509Certificate2 sslCertificate = null,
     Guid?token = null,
     LeMessageFormatter formatter = null)
     : this(new TcpConnection(address, port, sslCertificate), token, formatter)
 {
 }
Exemplo n.º 4
0
 public LeClient(
     TcpConnection connection,
     Guid?token = null,
     LeMessageFormatter formatter = null)
 {
     this.connection  = connection;
     this.formatter   = formatter ?? new LeMessageFormatter();
     this.tokenString = token != null?token.ToString() : string.Empty;
 }
Exemplo n.º 5
0
 public static LeLogger CreateTokenBasedLogger(Guid token, bool? useSsl = null, LeMessageFormatter formatter = null)
 {
     return new LeLogger(
         new LeClient(
             address: LeConfiguration.DefaultAddress,
             port: useSsl == true ? LeConfiguration.DefaultSslPort : LeConfiguration.DefaultPort,
             sslCertificate: useSsl == true ? LeConfiguration.DefaultSslCertificate : null,
             token: token,
             formatter: formatter));
 }
Exemplo n.º 6
0
        private LeLogger CreateLogger()
        {
            var formatter = new LeMessageFormatter(
                logId: LogId,
                hostname: LogHostname ? LeConfiguration.GetValidHostName(HostName) : null);

            return IsUsingDataHub
                ? LeLogger.CreateDataHubLogger(DataHubAddress, DataHubPort, formatter)
                : LeLogger.CreateTokenBasedLogger(LeConfiguration.GetValidToken(Token), Ssl, formatter);
        }
Exemplo n.º 7
0
 public static LeLogger CreateDataHubLogger(string address, int port, LeMessageFormatter formatter = null)
 {
     return new LeLogger(new LeClient(address, port, formatter: formatter));
 }
Exemplo n.º 8
0
 public static LeLogger CreateDataHubLogger(string address, int port, LeMessageFormatter formatter = null)
 {
     return(new LeLogger(new LeClient(address, port, formatter: formatter)));
 }
Exemplo n.º 9
0
 public static LeLogger CreateTokenBasedLogger(Guid token, bool?useSsl = null, LeMessageFormatter formatter = null)
 {
     return(new LeLogger(
                new LeClient(
                    address: LeConfiguration.DefaultAddress,
                    port: useSsl == true ? LeConfiguration.DefaultSslPort : LeConfiguration.DefaultPort,
                    sslCertificate: useSsl == true ? LeConfiguration.DefaultSslCertificate : null,
                    token: token,
                    formatter: formatter)));
 }