Replies: 1 comment 1 reply
-
Hey @Carsak, thanks for bringing this up. It seems like you mix up client-side and server-side in your first example. In your first lines of code you create a new $connector->connect($uri)->then(function (React\Socket\ConnectionInterface $connection) {
$connection->write('...');
$connection->end();
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
}); What you're actually doing with The problem in your second example seems to be your Also worth noticing: you will only see your 'data event' once you receive data from the server side. This event will not be triggered by writing data on you client side to the server. I hope this helps 👍 |
Beta Was this translation helpful? Give feedback.
-
Hello
I want to do periodic job(check row in DB) inside socket client
I tried to do like in this issue reactphp/socket#167
My code
so 'data event' works fine
but periodic doesnt work
I tried to do this second variant:
But in this case only periodic event works and I cannot receive any "data event"
Beta Was this translation helpful? Give feedback.
All reactions