@@ -29,7 +29,7 @@ public class ConnectionSettingsBuilder {
2929 private boolean _tlsVerifyCert = true ;
3030 private UserCredentials _defaultCredentials ;
3131 private ClientCertificate _defaultClientCertificate ;
32- private LinkedList <InetSocketAddress > _hosts = new LinkedList <>();
32+ private LinkedList <Endpoint > _hosts = new LinkedList <>();
3333 private long _keepAliveTimeout = Consts .DEFAULT_KEEP_ALIVE_TIMEOUT_IN_MS ;
3434 private long _keepAliveInterval = Consts .DEFAULT_KEEP_ALIVE_INTERVAL_IN_MS ;
3535 private Long _defaultDeadline = null ;
@@ -54,7 +54,7 @@ public KurrentDBClientSettings buildConnectionSettings() {
5454 _tlsVerifyCert ,
5555 _defaultCredentials ,
5656 _defaultClientCertificate ,
57- _hosts .toArray (new InetSocketAddress [0 ]),
57+ _hosts .toArray (new Endpoint [0 ]),
5858 _keepAliveTimeout ,
5959 _keepAliveInterval ,
6060 _defaultDeadline ,
@@ -155,14 +155,15 @@ public ConnectionSettingsBuilder defaultClientCertificate(ClientCertificate defa
155155 * Adds an endpoint the client will use to connect.
156156 */
157157 public ConnectionSettingsBuilder addHost (String host , int port ) {
158- return addHost (new InetSocketAddress (host , port ));
158+ this ._hosts .add (new Endpoint (host , port ));
159+ return this ;
159160 }
160161
161162 /**
162163 * Adds an endpoint the client will use to connect.
163164 */
164165 public ConnectionSettingsBuilder addHost (InetSocketAddress host ) {
165- this ._hosts .push (host );
166+ this ._hosts .push (new Endpoint ( host . getHostName (), host . getPort ()) );
166167 return this ;
167168 }
168169
0 commit comments