Registry / networking / react-datagram

react-datagram

JSON →
library1.10.0phppackagistunverified

Event-driven UDP datagram socket client and server for ReactPHP

composer require react/datagram
INSTALL
IMPORT
SIG · REACT-DATAGRAM
R
react-datagram
networkingphpv1.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Factory
use React\Datagram\Factory;

Create a UDP server that listens on port 9999.

use React\Datagram\Factory; $loop = React\EventLoop\Loop::get(); $factory = new Factory($loop); $factory->createServer('0.0.0.0:9999')->then(function ($server) { $server->on('message', function ($data, $address) { echo "Received: $data from $address\n"; }); }); $loop->run();
Debug
Known issues
breakingRequires ReactPHP event loop; not suitable for synchronous code.
fix
Ensure you have react/event-loop installed and use an event loop.
affects: >=1.0.0
Upgrade
Version history
1.10.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
react-datagram — pip install react-datagram · libregistry