link

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: LGPL-3.0 Imports: 9 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Link used to establish

func NewLink() *Link

func (*Link) CloseConn

func (this *Link) CloseConn()

close connection

func (*Link) GetAddr

func (this *Link) GetAddr() string

get address

func (*Link) GetConn

func (this *Link) GetConn() net.Conn

get connection

func (*Link) GetID

func (this *Link) GetID() uint64

GetID return if from peer

func (*Link) GetPort

func (this *Link) GetPort() uint16

get port number

func (*Link) GetRXTime

func (this *Link) GetRXTime() time.Time

GetRXTime return the latest message time

func (*Link) Rx

func (this *Link) Rx()

func (*Link) Send added in v1.2.0

func (this *Link) Send(msg types.Message) error

func (*Link) SendRaw added in v1.2.0

func (this *Link) SendRaw(rawPacket []byte) error

func (*Link) SetAddr

func (this *Link) SetAddr(addr string)

set address

func (*Link) SetChan

func (this *Link) SetChan(msgchan chan *types.MsgPayload)

set message channel for link layer

func (*Link) SetConn

func (this *Link) SetConn(conn net.Conn)

set connection

func (*Link) SetID

func (this *Link) SetID(id uint64)

SetID set peer id to link

func (*Link) SetPort

func (this *Link) SetPort(p uint16)

set port number

func (*Link) UpdateRXTime

func (this *Link) UpdateRXTime(t time.Time)

record latest message time

func (*Link) Valid

func (this *Link) Valid() bool

If there is connection return true

Jump to

Keyboard shortcuts

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