nets

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package nets : net connection provider

Index

Constants

View Source
const (
	// MaxRetryInterval retry interval time when reconnect
	MaxRetryInterval = time.Second * 30

	// MaxRetryCount retry max count when reconnect
	MaxRetryCount = 3
)

Variables

This section is empty.

Functions

func CalculateInterval

func CalculateInterval(t time.Duration) time.Duration

CalculateInterval calculate retry interval

func CalculateRandTime

func CalculateRandTime(sed int) time.Duration

CalculateRandTime returns a non-negative pseudo-random time in the half-open interval [0,sed)

func ConvertIpToUint32

func ConvertIpToUint32(ip string) uint32

ConvertIpToUint32 converts ip to little-endian uint32 format

func ConvertPortToBigEndian

func ConvertPortToBigEndian(little uint32) uint32

ConvertPortToBigEndian convert uint32 to network order

func CopyIpByteFromSlice added in v0.4.0

func CopyIpByteFromSlice(dst *[16]byte, src []byte)

func GrpcConnect

func GrpcConnect(addr string) (*grpc.ClientConn, error)

GrpcConnect creates a client connection to the given addr

func TriggerControlCommand added in v0.4.0

func TriggerControlCommand(oper int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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