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