定制 buibr/multicast-ip 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

buibr/multicast-ip

最新稳定版本:v2.0

Composer 安装命令:

composer require buibr/multicast-ip

包简介

Multicast IP helper and manipulator

README 文档

README

This package provides a set of functions for manipulating and validating Multicast IP addresses. Multicast IP addresses are used for communication between multiple hosts on a network. This package helps in validating and manipulating the Multicast IP addresses in various formats.

Installation

You can install this package via composer using the following command:

composer require buibr/multicast-ip

Usage

Validating Multicast IP addresses

You can use the isValidMulticastIP function to check if a given IP address is a valid Multicast IP address. It returns true if the IP address is valid, otherwise false.

use Buibr\Multicast\Multicast;

$ipAddress = '239.255.0.1';

if (Multicast::isValidMulticastIP($ipAddress)) {
    echo "Valid Multicast IP";
}

Add / Substract

use Buibr\Multicast\Multicast;

$ip = Multicast::create('udp://239.0.0.10:12345');

$ip->add(); 
//or
$ip->getIp()->increment();
print (string)$mc // 'udp://239.0.0.11:12345', 

$ip->sub();
or
$ip->getIp()->decrement();
print (string)$mc // 'udp://239.0.0.9:12345',

Range group detector

use Buibr\Multicast\Multicast;

$url = Multicast::create('udp://239.0.0.1:12345');
$url->getIp()->isLocal(); // true 

$url = Multicast::create('udp://224.0.1.1:12345');
$url->getIp()->isGlobal(); // true

统计信息

  • 总下载量: 307
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-11