You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of the two original examples, I can get the first to run as a command line fired PHP script. If I put either example into an existing PHP application I get the following:
$connString = "ws://qa.bei-oregon.com:8084";
$loginString="valid_user=999999&uid=LKLO&@#NC(*#@";
// $bcastData is passed into the function that runs the below// Pawl extended example$reactConnector = new \React\Socket\Connector();
$loop = \React\EventLoop\Loop::get();
$connector = new \Ratchet\Client\Connector($loop);
$connector($connString, [], ['Origin' => 'http://qa.bei-oregon.com'])
->then(function(Ratchet\Client\WebSocket$conn) use ( $loop ) {
global$loginString; // Only way to get the $loginString into this area;global$bcastData; // Only way that I can figure out how to get this usable inside the $connector->then// Simple echo on message received for the test.$conn->on('message', function(\Ratchet\RFC6455\Messaging\MessageInterface$msg) use ($conn) {
echo"Received: {$msg}\n";
});
$conn->on('close', function($code = null, $reason = null) {
echo"Connection closed ({$code} - {$reason})\n";
});
$conn->send($loginString);
$conn->send($bcastData);
}, function(\Exception$e) use ($loop) {
echo"Could not connect: {$e->getMessage()}\n";
$loop->stop();
});
Edited: Please take the time to properly report and format tickets, thank you.
The text was updated successfully, but these errors were encountered:
Of the two original examples, I can get the first to run as a command line fired PHP script. If I put either example into an existing PHP application I get the following:
Code that generated the above:
Edited: Please take the time to properly report and format tickets, thank you.
The text was updated successfully, but these errors were encountered: