Closed kijin closed 8 years ago
This was a very helpful change. Thank you. I updated my app with your modified file and all works fine and faster.
@kijin I added a closeConnection method to your class so I could properly close out the CURL to free up the firebase connection:
public function closeConnection() { if ($this->_ch) { curl_close($this->_ch); } }
closeConnection looks like a very nice addition. Thanks for the input!
Unfortunately I can't merge your pull request in this state. Can you please bring your code up-to-date?
This feature is supported from v2.2.0
I removed all instances of
curl_close()
and turned$ch
into a property so that the HTTP connection will stay open (using KeepAlive) throughout the lifetime of the object.All unit tests seem to be passing, but there may be special cases not covered by the tests (e.g. what if the server drops the connection in between two requests?) so very thorough testing is recommended.