tcpclient

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

Index

Constants

This section is empty.

Variables

View Source
var BytesPool *bytePool
View Source
var (
	ErrNodesUnavailable = errors.New("All nodes unvailabale")
)
View Source
var ErrorEmptyBlockBody = errors.New("block is empty")
View Source
var ErrorWrongSizeBytes = errors.New("wrong size bytes")

Functions

func BroadcastNodeConnInfo

func BroadcastNodeConnInfo(tcpAddress string, data []byte, logger *log.Entry) error

func CheckConfirmation

func CheckConfirmation(host string, blockID int64, logger *log.Entry) (hash string)

func GetBlockBodiesChan

func GetBlockBodiesChan(ctx context.Context, src io.ReadCloser, blocksCount int64) (<-chan []byte, <-chan error)

func GetBlocksBodies

func GetBlocksBodies(ctx context.Context, host string, blockID int64, reverseOrder bool) (<-chan []byte, error)

GetBlocksBodies send GetBodiesRequest returns channel of binary blocks data

func GetMaxBlockID

func GetMaxBlockID(host string) (blockID int64, err error)

func HostWithMaxBlock

func HostWithMaxBlock(ctx context.Context, hosts []string) (bestHost string, maxBlockID int64, err error)

func MarshalTxPacket

func MarshalTxPacket(txes []sqldb.Transaction) ([]byte, error)

func NormalizeHostAddress

func NormalizeHostAddress(address string, defaultPort int64) (string, error)

NormalizeHostAddress get address. if port not defined returns combined string with ip and defaultPort

func SendFullBlockToAll

func SendFullBlockToAll(ctx context.Context, hosts []string, block *sqldb.InfoBlock, txes []sqldb.Transaction, nodeID int64) error

func SendStopNetwork

func SendStopNetwork(addr string, req *network.StopNetworkRequest) error

func SendTransacitionsToAll

func SendTransacitionsToAll(ctx context.Context, hosts []string, txes []sqldb.Transaction) error

func UpdateMachineStatus

func UpdateMachineStatus(localAddress, tcpAddress string, logger *log.Entry) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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