addr

package
v0.0.0-...-d098e83 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	OnEventAddrMulticast OnEventAddrMulticastFunc
	// contains filtered or unexported fields
}

func (*Addr) Start

func (p *Addr) Start(addrChan chan<- interface{}, onEventAddrMulticast OnEventAddrMulticastFunc,
	multicastIP string, multicastPort uint16, networkInterfacenName string,
	addrName string, addrID uint32, addrIP string, addrPort uint16, addrData string) (err error)

multicastIP:239.0.0.8 multicastPort:8890 netName:eth0

func (*Addr) Stop

func (p *Addr) Stop()

type AddrJson

type AddrJson struct {
	//cmd:[0,第一次发送]
	//[1,平时发送]
	Cmd  uint32 `json:"cmd"`
	Name string `json:"name"`
	ID   uint32 `json:"id"`
	IP   string `json:"ip"`
	Port uint16 `json:"port"`
	Data string `json:"data"`
}

type EventAddrMulticast

type EventAddrMulticast struct {
	Addr     *Addr
	AddrJson AddrJson
}

添加组播事件

type OnEventAddrMulticastFunc

type OnEventAddrMulticastFunc func(name string, id uint32, ip string, port uint16, data string) int

会收到除了自己的组播信息

Jump to

Keyboard shortcuts

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