How to reconnect a client automatically on ratchetphp?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using rachetphp to create a client for an api server. But i have a problem, when my connection close, whatever the reason, i can't reconnect automatically. here the lib i use : https://github.com/ratchetphp/Pawl <?php require __DIR__ . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $connector = new Ratchet\Client\Connector($loop); $connector('ws://127.0.0.1:9000', ['protocol1', 'subprotocol2'], ['Origin' => 'http://localhost']) ->then(function(Ratchet\Client\WebSocket $conn) { $conn->on('message', function(\Ratchet