Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork27
Event-driven UDP client and server sockets for ReactPHP.
License
reactphp/datagram
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Event-driven UDP datagram socket client and server forReactPHP.
Onceinstalled, you can use the following code to connect to an UDP server listening onlocalhost:1234 and send and receive UDP datagrams:
$factory =newReact\Datagram\Factory();$factory->createClient('localhost:1234')->then(function (React\Datagram\Socket$client) {$client->send('first');$client->on('message',function($message,$serverAddress,$client) {echo'received "' .$message .'" from' .$serverAddress.PHP_EOL; });});
See also theexamples.
This library's API is modelled after node.js's API forUDP / Datagram Sockets (dgram.Socket).
The recommended way to install this library isthrough Composer.New to Composer?
This project followsSemVer.This will install the latest supported version:
composer require react/datagram:^1.10
See also theCHANGELOG for details about version upgrades.
This project aims to run on any platform and thus does not require any PHPextensions and supports running on legacy PHP 5.3 through current PHP 8+ andHHVM.It'shighly recommended to use PHP 7+ for this project.
To run the test suite, you first need to clone this repo and then install alldependenciesthrough Composer:
composer install
To run the test suite, go to the project root and run:
vendor/bin/phpunit
MIT, seeLICENSE file.
About
Event-driven UDP client and server sockets for ReactPHP.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors12
Uh oh!
There was an error while loading.Please reload this page.