link

package
v1.8.0-rc Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: LGPL-3.0 Imports: 9 Imported by: 4

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.6.0

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

func (*Link) SendRaw added in v1.6.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