Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Event-driven UDP client and server sockets for ReactPHP.

License

NotificationsYou must be signed in to change notification settings

reactphp/datagram

Repository files navigation

CI statusinstalls on Packagist

Event-driven UDP datagram socket client and server forReactPHP.

Quickstart example

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.

Usage

This library's API is modelled after node.js's API forUDP / Datagram Sockets (dgram.Socket).

Install

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.

Tests

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

License

MIT, seeLICENSE file.

About

Event-driven UDP client and server sockets for ReactPHP.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  
  •  
  •  

Contributors12

Languages


[8]ページ先頭

©2009-2025 Movatter.jp