示例#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;
        }
示例#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());
 }
示例#4
0
 public IKafkaConnection Create(KafkaEndpoint endpoint, TimeSpan responseTimeoutMs, IKafkaLog log)
 {
     return(new KafkaConnection(new KafkaTcpSocket(log, endpoint), responseTimeoutMs, log));
 }
示例#5
0
 protected bool Equals(KafkaEndpoint other)
 {
     return Equals(Endpoint, other.Endpoint);
 }
示例#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);
 }
示例#8
0
 protected bool Equals(KafkaEndpoint other)
 {
     return(Equals(Endpoint, other.Endpoint));
 }