neth

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Overview

Package neth provides some helpers for system net package.

Index

Constants

View Source
const UDPGuaranteedPayloadSize = 508

UDPGuaranteedPayloadSize is maximal guaranteed size of UDP payload which does not fragment and must be delivered. = 576 (RFC792) - 60 (Max IP Header Size) — 8 (UDP Header Size)

View Source
const UDPUsualMaxPayloadSize = 1432

UDPUsualMaxPayloadSize is usual size of UDP payload which does not fragment and must be delivered via internet (if no encapsulation is used). Primary used for servers where encapsulation more or less can be checked. 1500 (MTU) — 60(Max IP Header Size) — 8(UDP Header Size)

Variables

This section is empty.

Functions

func IPLen

func IPLen(ip net.IP) int

IPLen return length of given ip in bytes (4 for IPv4 even if it stored as IPv6). IPLen return 0 if given address is not valid IP v4 nor v6.

func IsIPv4

func IsIPv4(ip net.IP) bool

IsIPv4 return true if given ip is IPv4 address (even if it stored as IPv6).

func IsIPv6

func IsIPv6(ip net.IP) bool

IsIPv6 return true if given ip is IPv6 address (and it is not IPv4 address stored as v6).

func IsTimeout

func IsTimeout(err error) bool

IsTimeout return true if given err is timeout (err.Timeout() is true).

Types

This section is empty.

Directories

Path Synopsis
Package httph provides some helper for system http package.
Package httph provides some helper for system http package.

Jump to

Keyboard shortcuts

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