@@ -82,6 +82,7 @@ public static function create(UriInterface $uri, AuthenticateInterface $auth, Dr
8282 $ semaphore ,
8383 BoltFactory::create (),
8484 new ConnectionRequestData (
85+ $ uri ->getHost (),
8586 $ uri ,
8687 $ auth ,
8788 $ conf ->getUserAgent (),
@@ -92,9 +93,10 @@ public static function create(UriInterface $uri, AuthenticateInterface $auth, Dr
9293 );
9394 }
9495
95- public function createOrGetPool (UriInterface $ uri ): ConnectionPool
96+ public function createOrGetPool (string $ hostname , UriInterface $ uri ): ConnectionPool
9697 {
9798 $ data = new ConnectionRequestData (
99+ $ hostname ,
98100 $ uri ,
99101 $ this ->data ->getAuth (),
100102 $ this ->data ->getUserAgent (),
@@ -130,7 +132,7 @@ public function acquire(SessionConfiguration $config): Generator
130132 foreach ($ addresses as $ address ) {
131133 $ triedAddresses [] = $ address ;
132134
133- $ pool = $ this ->createOrGetPool ($ this ->data ->getUri ()->withHost ($ address ));
135+ $ pool = $ this ->createOrGetPool ($ this ->data ->getUri ()->getHost (), $ this -> data -> getUri ()-> withHost ($ address ));
134136 try {
135137 /** @var BoltConnection $connection */
136138 $ connection = GeneratorHelper::getReturnFromGenerator ($ pool ->acquire ($ config ));
@@ -158,7 +160,7 @@ public function acquire(SessionConfiguration $config): Generator
158160 $ server = $ server ->withScheme ($ this ->data ->getUri ()->getScheme ());
159161 }
160162
161- return $ this ->createOrGetPool ($ server )->acquire ($ config );
163+ return $ this ->createOrGetPool ($ this -> data -> getUri ()-> getHost (), $ server )->acquire ($ config );
162164 }
163165
164166 /**
@@ -200,7 +202,7 @@ private function routingTable(BoltConnection $connection, SessionConfiguration $
200202
201203 public function release (ConnectionInterface $ connection ): void
202204 {
203- $ this ->createOrGetPool ($ connection ->getServerAddress ())->release ($ connection );
205+ $ this ->createOrGetPool ($ connection ->getServerAddress ()-> getHost (), $ connection -> getServerAddress () )->release ($ connection );
204206 }
205207
206208 private function createKey (ConnectionRequestData $ data , ?SessionConfiguration $ config = null ): string
0 commit comments