varspool / Wrench

A simple PHP WebSocket implementation for PHP 7.1
Do What The F*ck You Want To Public License
596 stars 210 forks source link

Wrench client memory exhausted because of received #120

Closed choval closed 6 years ago

choval commented 6 years ago

/lib/Client.php wrench just keeps pushing payloads to the received array without ever cleaning it.

If the Wrench client is run in a loop, the array just keeps growing. I don't see any reason to keep the previous received messages and calculating the diff on each receive() call.

choval commented 6 years ago

I forgot to mention, onData is the method that pushes the payload to the received array.

choval commented 6 years ago

Closing, made a pull request: #121