_2_sharing_memory_by_communicating

package
v0.0.0-...-a7c7adb Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// contains filtered or unexported fields
}

func NewHost

func NewHost() *Host

func (*Host) Add

func (h *Host) Add(p *Peer)

具体方法

func (*Host) Broadcast

func (h *Host) Broadcast(msg string)

func (*Host) RemovePeer

func (h *Host) RemovePeer(pid string)

type Info

type Info struct {
	Peer
	// contains filtered or unexported fields
}

type Peer

type Peer struct {
	ID string
}

Peer代表一个节点

func (*Peer) WriteMsg

func (p *Peer) WriteMsg(msg string)

Jump to

Keyboard shortcuts

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