cluster

package module
v3.0.0-...-a16577b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

cluster plugin

cluster plugin for monibuca 实现了基本的集群功能,里面包含一对发布者和订阅者,分别在主从服务器中启用,进行连接。 起基本原理就是,在主服务器启动端口监听,从服务器收到播放请求时,如果从服务器没有对应的发布者,则向主服务器发起请求,主服务器收到来自从服务器的请求时,将该请求作为一个订阅者。从服务器则把tcp连接作为发布者,实现视频流的传递过程。

插件名称

Cluster

配置

源服务器的配置是ListenAddr,用来监听从服务器的请求。 边缘服务器的配置是OriginServer,表示源服务器的地址。 当然服务器可以既是源服务器也是边缘服务器,即充当中转站。

边缘服务器的配置

[Cluster]
OriginServer = "localhost:2019"

源服务器的配置

[Cluster]
ListenAddr = ":2019"

示意图

sketch

Documentation

Index

Constants

View Source
const (
	MSG_PULSE byte
	MSG_AUDIO
	MSG_VIDEO
	MSG_SUBSCRIBE
	MSG_UNSUBSCRIBE
	MSG_AUTH
	MSG_SUMMARY
	MSG_LOG
	MSG_PUBLISH
	MSG_UNPUBLISH
	MSG_VIDEOTRACK
	MSG_AUDIOTRACK

	STREAMTYPE_ORIGIN = "ClusterOrigin" //源流
	STREAMTYPE_SINK   = "ClusterSink"   //下级流
)

Variables

This section is empty.

Functions

func ListenBare

func ListenBare() error

Types

type Cluster

type Cluster struct {
	*bufio.Writer
	*bufio.Reader
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Cluster) ReadAudioPack

func (c *Cluster) ReadAudioPack()

func (*Cluster) ReadAudioTrack

func (c *Cluster) ReadAudioTrack()

func (*Cluster) ReadString

func (c *Cluster) ReadString() string

func (*Cluster) ReadUint32

func (c *Cluster) ReadUint32() uint32

func (*Cluster) ReadVideoPack

func (c *Cluster) ReadVideoPack()

func (*Cluster) ReadVideoTrack

func (c *Cluster) ReadVideoTrack()

func (*Cluster) WriteAT

func (c *Cluster) WriteAT(streamPath string, name string, at *AudioTrack)

func (*Cluster) WriteAudioPack

func (c *Cluster) WriteAudioPack(streamPath string, name string, pack AudioPack)

func (*Cluster) WritePublish

func (c *Cluster) WritePublish(streamPath string)

func (*Cluster) WritePulse

func (c *Cluster) WritePulse()

func (*Cluster) WriteReport

func (c *Cluster) WriteReport()

func (*Cluster) WriteString

func (c *Cluster) WriteString(s string)

func (*Cluster) WriteSubscribe

func (c *Cluster) WriteSubscribe(streamPath string)

func (*Cluster) WriteSummary

func (c *Cluster) WriteSummary(flag byte)

func (*Cluster) WriteUint32

func (c *Cluster) WriteUint32(num uint32)

func (*Cluster) WriteUnPublish

func (c *Cluster) WriteUnPublish(streamPath string)

func (*Cluster) WriteUnSubscribe

func (c *Cluster) WriteUnSubscribe(streamPath string)

func (*Cluster) WriteVT

func (c *Cluster) WriteVT(streamPath string, name string, vt *VideoTrack)

func (*Cluster) WriteVideoPack

func (c *Cluster) WriteVideoPack(streamPath string, name string, pack VideoPack)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL