Download the PHP package clue/multicast-react without Composer

On this page you can find all versions of the php package clue/multicast-react. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package multicast-react

clue/reactphp-multicast

CI status installs on Packagist

Simple, event-driven multicast UDP message client and server for ReactPHP.

Multicast UDP messages are needed for quite a few (low-level) networking protocols. Among others, multicast networking is the basis for mDNS (Multicast DNS), HTTPMU (Multicast UDP HTTP Messages), UPnP/SSDP (Universal Plug and Play / Simple Service Discovery Protocol) and others. This library exposes a simple subset of commonly needed functionality for multicast networking through an easy to use API.

Table of contents

Support us

We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by becoming a sponsor on GitHub. Sponsors get numerous benefits in return, see our sponsoring page for details.

Let's take these projects to the next level together! 🚀

Quickstart example

Once installed, you can use the following code to create a simple echo server that listens for incoming multicast messages:

See also the examples.

Usage

Factory

The Factory is responsible for creating your SocketInterface instances.

This class takes an optional LoopInterface|null $loop parameter that can be used to pass the event loop instance to use for this object. You can use a null value here in order to use the default loop. This value SHOULD NOT be given unless you're sure you want to explicitly use a given event loop instance.

createSender()

The createSender(): SocketInterface method can be used to create a socket capable of sending outgoing multicast datagrams and receiving incoming unicast responses. It returns a SocketInterface instance.

This method works on PHP versions as old as PHP 5.3 (and up), as its socket API has always been level 1 multicast conformant.

createReceiver()

The createReceiver(string $address): SocketInterface method can be used to create a socket capable of receiving incoming multicast datagrams and sending outgoing unicast or multicast datagrams. It returns a SocketInterface instance.

This method requires PHP 5.4+ and ext-sockets. Otherwise, it will throw a BadMethodCallException. This is a requirement because receiving multicast datagrams requires a level 2 multicast conformant socket API. The required multicast socket options and constants have been added with PHP 5.4+. These options are only available to the low level socket API (ext-sockets), not to the newer stream based networking API.

Internally, this library uses a workaround to create stream based sockets and then sets the required socket options on its underlying low level socket resource. This is done because ReactPHP is built around the general purpose stream based API and has only somewhat limited support for the low level socket API.

SocketInterface

The Factory creates instances of the React\Datagram\SocketInterface from the react/datagram package. This means that you can use all its normal methods like so:

Please refer to the datagram documentation for more details.

Install

The recommended way to install this library is through Composer. New to Composer?

This project follows SemVer. This will install the latest supported version:

See also the CHANGELOG for details about version upgrades.

This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. It's highly recommended to use the latest supported PHP version for this project.

The createSender() method works on all supported platforms without any additional requirements. However, the createReceiver() method requires PHP 5.4 (or up) and ext-sockets. See above for more details.

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:

To run the test suite, go to the project root and run:

License

This project is released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.


All versions of multicast-react with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
react/event-loop Version ^1.2
react/datagram Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package clue/multicast-react contains the following files

Loading the files please wait ....