Download the PHP package buexplain/netsvr-protocol without Composer

On this page you can find all versions of the php package buexplain/netsvr-protocol. 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 netsvr-protocol

netsvr-protocol

这套protohttps://github.com/buexplain/netsvr的网关层与业务层的交互协议。

指令有如下三种类别:

  1. 网关单向转发给业务进程的指令
  2. 业务进程单向请求网关的指令
  3. 业务进程请求网关,网关处理完毕再响应给业务进程的指令

网关单向转发给业务进程的指令

名称 编号 proto 说明
websocket连接打开 ConnOpen connOpen.proto 网关转发客户端连接打开的信息到业务进程
websocket连接关闭 ConnClose connClose.proto 网关转发客户端连接关闭的信息到业务进程
透传客户端的websocket数据 Transfer transfer.proto 网关转发客户端连接发来的数据到业务进程

业务进程单向请求网关的指令

名称 编号 proto 说明
更新连接的信息 ConnInfoUpdate connInfoUpdate.proto 每个客户端连接都可以在网关中存储:业务系统唯一id、订阅的主题标签、session信息,该指令用于设置这些信息
删除连接的信息 ConnInfoDelete connInfoDelete.proto 删除客户连接的:业务系统唯一id、订阅的主题标签、session信息
广播 Broadcast broadcast.proto 给网关中所有客户端连接都发送一条信息
根据uniqId组播 Multicast multicast.proto 给指定的某几个客户端连接发送一条信息
根据customerId组播 MulticastByCustomerId multicastByCustomerId.proto 给指定的某几个客户端id发送一条信息
根据uniqId单播 SingleCast singleCast.proto 给指定的某个客户连接发送一条信息
根据uniqId批量单播 SingleCastBulk singleCastBulk.proto 将多对单播数据打包成一个块,一次性发送给网关
根据customerId单播 SingleCastByCustomerId singleCastByCustomerId.proto 给指定的某个客户端id发送一条信息
根据customerId批量单播 SingleCastBulkByCustomerId singleCastBulkByCustomerId.proto 将多对单播数据打包成一个块,一次性发送给网关
订阅某几个主题 TopicSubscribe topicSubscribe.proto 客户端连接订阅某几个主题的数据,比如客户端加入的群的id,用于接收该群的消息
取消订阅某几个主题 TopicUnsubscribe topicUnsubscribe.proto 客户端连取消订阅某几个主题的数据,比如客户端退群了,可以将之前订阅的群id删除
删除某几个主题 TopicDelete topicDelete.proto 删除网关中某几个主题,所有订阅了这些被删除主题的客户端连接都会取消订阅它们
给某几个主题发布信息 TopicPublish topicPublish.proto 一份消息发布到多个主题
批量发布到某几个主题 TopicPublishBulk topicPublishBulk.proto 多份消息发布到多个主题,或者多份消息发布到一个主题
强制关闭某几个连接 ForceOffline forceOffline.proto 根据uniqId,强制关闭某几个客户端连接,比如客户在多个设备连接到网关,则可用此指令去强制关闭客户其它设备的连接
强制关闭某几个客户的所有连接 ForceOfflineByCustomerId forceOfflineByCustomerId.proto 根据customerId强制关闭某个客户连接,一般是剔下线用,该客户在所有设备登录到网关的所有连接都会被关闭
强制关闭某几个空session、空customerId的连接 ForceOfflineGuest forceOfflineGuest.proto 强制关闭某个空session值与空customerId的连接,比如客户端连接到网关,但是并没有发起账号密码登录的请求,此时业务侧又不希望此类连接一直逗留在网关中,则可以用该指令去延迟一分钟后强制关闭它,当然如果一分钟后,客户端登录成功,则不会关闭

业务进程请求网关,网关处理完毕再响应给业务进程的指令

名称 编号 proto 说明
注册到网关 Register registerResp.proto 业务进程向网关的worker服务器发出注册指令,注册成功后,business会收到worker服务器转发的客户端websocket消息
撤销注册 Unregister unRegisterResp.proto 业务进程向网关的worker服务器发出取消注册指令,取消注册成功后,业务进程不会再收到客户端websocket消息
检查uniqId是否在线 CheckOnline checkOnlineResp.proto 判断某几个uniqId是否在在线,有则返回uniqId值
获取网关中全部的customerId CustomerIdList customerIdListResp.proto -
统计网关中customerId的数量 CustomerIdCount customerIdCountResp.proto -
获取全部连接的uniqId UniqIdList uniqIdListResp.proto -
统计网关的在线连接数 UniqIdCount uniqIdCountResp.proto -
获取网关的全部主题 TopicList topicListResp.proto -
统计网关的主题数量 TopicCount topicCountResp.proto -
获取网关中某几个主题包含的uniqId TopicUniqIdList topicUniqIdListResp.proto -
统计网关中某几个主题包含的uniqId数量 TopicUniqIdCount topicUniqIdCountResp.proto -
获取网关中某几个主题的customerId TopicCustomerIdList topicCustomerIdListResp.proto -
统计网关某个主题的customerId数量 TopicCustomerIdCount topicCustomerIdCountResp.proto -
获取uniqId的连接信息 ConnInfo connInfoResp.proto -
获取customerId的连接信息 ConnInfoByCustomerId connInfoByCustomerIdResp.proto -
获取网关状态的统计信息 Metrics metricsResp.proto -
设置并返回限流配置 Limit limitResp.proto 先更新限流配置,如果传递的值无效,则会忽略它;再返回网关中的最新的限流配置

All versions of netsvr-protocol with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 buexplain/netsvr-protocol contains the following files

Loading the files please wait ....