Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Latest commit

 

History

History
151 lines (86 loc) · 4.19 KB

_net_protocol_flowcontrol_.flowcontrol.md

File metadata and controls

151 lines (86 loc) · 4.19 KB

ethereumjs-client"net/protocol/flowcontrol"FlowControl

Class: FlowControl

LES flow control manager

memberof module:net/protocol

Hierarchy

  • FlowControl

Index

Constructors

Properties

Methods

Constructors

constructor

+ new FlowControl(options?: FlowControlOptions): FlowControl

Defined in lib/net/protocol/flowcontrol.ts:32

Parameters:

Name Type
options? FlowControlOptions

Returns: FlowControl

Properties

bl

bl: number

Defined in lib/net/protocol/flowcontrol.ts:28


in

in: Map‹string, FlowParams›

Defined in lib/net/protocol/flowcontrol.ts:32


mrc

mrc: Mrc

Defined in lib/net/protocol/flowcontrol.ts:29


mrr

mrr: number

Defined in lib/net/protocol/flowcontrol.ts:30


out

out: Map‹string, FlowParams›

Defined in lib/net/protocol/flowcontrol.ts:31

Methods

handleReply

handleReply(peer: Peer, bv: number): void

Defined in lib/net/protocol/flowcontrol.ts:50

Process reply message from an LES peer by updating its BLE value

Parameters:

Name Type Description
peer Peer LES peer
bv number latest buffer value

Returns: void


handleRequest

handleRequest(peer: Peer, messageName: string, count: number): number

Defined in lib/net/protocol/flowcontrol.ts:90

Calculate new buffer value for an LES peer after an incoming request is processed. If the new value is negative, the peer should be dropped by the caller.

Parameters:

Name Type Description
peer Peer LES peer
messageName string message name
count number number of items to request from peer

Returns: number

new buffer value after request is sent (if negative, drop peer)


maxRequestCount

maxRequestCount(peer: Peer, messageName: string): number

Defined in lib/net/protocol/flowcontrol.ts:63

Calculate maximum items that can be requested from an LES peer

Parameters:

Name Type Description
peer Peer LES peer
messageName string message name

Returns: number

maximum count