@@ -37,7 +37,7 @@ abstract class WSConnectorAbstract implements ConnectorInterface
37
37
*
38
38
* @var string
39
39
*/
40
- private $ currentNodeURL ;
40
+ protected static $ currentNodeURL ;
41
41
42
42
/**
43
43
* waiting answer from Node during $wsTimeoutSeconds seconds
@@ -145,18 +145,18 @@ public function newConnection($nodeUrl)
145
145
146
146
public function getCurrentUrl ()
147
147
{
148
- if ($ this -> currentNodeURL === null ) {
148
+ if (static :: $ currentNodeURL === null ) {
149
149
if (is_array (static ::$ nodeURL )) {
150
150
$ this ->reserveNodeUrlList = static ::$ nodeURL ;
151
151
$ url = array_shift ($ this ->reserveNodeUrlList );
152
152
} else {
153
153
$ url = static ::$ nodeURL ;
154
154
}
155
155
156
- $ this -> currentNodeURL = $ url ;
156
+ static :: $ currentNodeURL = $ url ;
157
157
}
158
158
159
- return $ this -> currentNodeURL ;
159
+ return static :: $ currentNodeURL ;
160
160
}
161
161
162
162
public function isExistReserveNodeUrl ()
@@ -166,11 +166,13 @@ public function isExistReserveNodeUrl()
166
166
167
167
protected function setReserveNodeUrlToCurrentUrl ()
168
168
{
169
- $ this -> currentNodeURL = array_shift ($ this ->reserveNodeUrlList );
169
+ static :: $ currentNodeURL = array_shift ($ this ->reserveNodeUrlList );
170
170
}
171
171
172
172
public function connectToReserveNode ()
173
173
{
174
+ $ connection = $ this ->getConnection ();
175
+ $ connection ->close ();
174
176
$ this ->setReserveNodeUrlToCurrentUrl ();
175
177
return $ this ->newConnection ($ this ->getCurrentUrl ());
176
178
}
0 commit comments