arnet

package
v0.0.0-...-0992052 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HistDecoder

func HistDecoder(histBytes []byte) (hist *bg.Hist, err error)

HistDecoder decodes game history.

func HistEncode

func HistEncode(hist *bg.Hist) (histBytes []byte, err error)

HistEncode encodes game history.

func PokeClient

func PokeClient(clientAdr, myAddr string)

PokeClient poke the client with address to signal it is ready.

func PokeListener

func PokeListener(ln net.Listener, addCh chan<- string)

PokeListener listen for pokes and send them on. Create listner with ln, err := net.Listen("tcp", clientAddr) stop with ln.Close() should be called in a goroutine.

Types

type Receiver

type Receiver struct {
	HistCh chan []byte
	// contains filtered or unexported fields
}

Receiver a zmq receiver of game histories.

func NewReceiver

func NewReceiver(port string) (nz *Receiver, err error)

NewReceiver creates a zmq receiver of game histories.

func (*Receiver) Close

func (nz *Receiver) Close() (err error)

Close closes the zmq receiver.

func (*Receiver) Start

func (nz *Receiver) Start()

Start starts zmg reciver of histories.

type Sender

type Sender struct {
	HistCh   chan *bg.Hist
	BrokenCh chan *bg.Hist
	// contains filtered or unexported fields
}

Sender a zmq sender of game history

func NewSender

func NewSender(addr string) (nz *Sender, err error)

NewSender creates a zmq sender of game histories.

func (*Sender) Start

func (nz *Sender) Start()

Start starts a zmq sender.

func (*Sender) Stop

func (nz *Sender) Stop()

Stop stops a zmq sender.

Jump to

Keyboard shortcuts

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