agent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package agent-tcp implements a TCP based agent to participate in consensus

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPPeer

type TCPPeer struct {
	sync.Mutex // mutex for all fields
	// contains filtered or unexported fields
}

TCPPeer contains information related to a tcp connection

func NewTCPPeer

func NewTCPPeer(conn net.Conn) *TCPPeer

NewTCPPeer creates a consensus peer based on net.Conn and and async-io(gaio) watcher for sending

func (*TCPPeer) GetPublicKey

func (p *TCPPeer) GetPublicKey() *ecdsa.PublicKey

GetPublicKey returns peer's public key as identity

func (*TCPPeer) RemoteAddr

func (p *TCPPeer) RemoteAddr() net.Addr

RemoteAddr should return peer's address as identity

func (*TCPPeer) Send

func (p *TCPPeer) Send(out []byte) error

Send message to this peer

Jump to

Keyboard shortcuts

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