Exemplo n.º 1
0
        public KafkaEndpoint Resolve(Uri kafkaAddress, IKafkaLog log)
        {
            var ipAddress  = GetFirstAddress(kafkaAddress.Host, log);
            var ipEndpoint = new IPEndPoint(ipAddress, kafkaAddress.Port);

            var kafkaEndpoint = new KafkaEndpoint()
            {
                ServeUri = kafkaAddress,
                Endpoint = ipEndpoint
            };

            return(kafkaEndpoint);
        }
        public KafkaEndpoint Resolve(Uri kafkaAddress, IKafkaLog log)
        {
            var ipAddress = GetFirstAddress(kafkaAddress.Host, log);
            var ipEndpoint = new IPEndPoint(ipAddress, kafkaAddress.Port);

            var kafkaEndpoint = new KafkaEndpoint()
            {
                ServeUri = kafkaAddress,
                Endpoint = ipEndpoint
            };

            return kafkaEndpoint;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Construct socket and open connection to a specified server.
 /// </summary>
 /// <param name="log">Logging facility for verbose messaging of actions.</param>
 /// <param name="endpoint">The IP endpoint to connect to.</param>
 /// <param name="delayConnectAttemptMS">Time in milliseconds to delay the initial connection attempt to the given server.</param>
 public KafkaTcpSocket(IKafkaLog log, KafkaEndpoint endpoint, int delayConnectAttemptMS = 0)
 {
     _log      = log;
     _endpoint = endpoint;
     Task.Delay(TimeSpan.FromMilliseconds(delayConnectAttemptMS)).ContinueWith(x => TriggerReconnection());
 }
Exemplo n.º 4
0
 public IKafkaConnection Create(KafkaEndpoint endpoint, TimeSpan responseTimeoutMs, IKafkaLog log)
 {
     return(new KafkaConnection(new KafkaTcpSocket(log, endpoint), responseTimeoutMs, log));
 }
Exemplo n.º 5
0
 protected bool Equals(KafkaEndpoint other)
 {
     return Equals(Endpoint, other.Endpoint);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Construct socket and open connection to a specified server.
 /// </summary>
 /// <param name="log">Logging facility for verbose messaging of actions.</param>
 /// <param name="endpoint">The IP endpoint to connect to.</param>
 /// <param name="delayConnectAttemptMS">Time in milliseconds to delay the initial connection attempt to the given server.</param>
 public KafkaTcpSocket(IKafkaLog log, KafkaEndpoint endpoint, int delayConnectAttemptMS = 0)
 {
     _log = log;
     _endpoint = endpoint;
     Task.Delay(TimeSpan.FromMilliseconds(delayConnectAttemptMS)).ContinueWith(x => TriggerReconnection());
 }
 public IKafkaConnection Create(KafkaEndpoint endpoint, TimeSpan responseTimeoutMs, IKafkaLog log)
 {
     return new KafkaConnection(new KafkaTcpSocket(log, endpoint), responseTimeoutMs, log);
 }
Exemplo n.º 8
0
 protected bool Equals(KafkaEndpoint other)
 {
     return(Equals(Endpoint, other.Endpoint));
 }