Documentation ¶
Overview ¶
Package nets : net connection provider
Index ¶
- Constants
- func CalculateInterval(t time.Duration) time.Duration
- func CalculateRandTime(sed int) time.Duration
- func ConvertIpToUint32(ip string) uint32
- func ConvertPortToBigEndian(little uint32) uint32
- func CopyIpByteFromSlice(dst *[16]byte, src []byte)
- func GrpcConnect(addr string) (*grpc.ClientConn, error)
- func TriggerControlCommand(oper int) error
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 ¶
CalculateInterval calculate retry interval
func CalculateRandTime ¶
CalculateRandTime returns a non-negative pseudo-random time in the half-open interval [0,sed)
func ConvertIpToUint32 ¶
ConvertIpToUint32 converts ip to little-endian uint32 format
func ConvertPortToBigEndian ¶
ConvertPortToBigEndian convert uint32 to network order
func CopyIpByteFromSlice ¶ added in v0.4.0
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.