gxnet

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 43

Documentation

Overview

Package gxnet encapsulates some network functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIPValidity added in v0.3.2

func CheckIPValidity(IPString string) bool

CheckIPValidity checks whether @IPString is a valid ip

func GetFileConnByFd added in v0.3.2

func GetFileConnByFd(fd int) (net.Conn, error)

func GetFileListenerByFd added in v0.3.2

func GetFileListenerByFd(fd int) (net.Listener, error)

!!!: this func is copied from acl-dev/go-master(https://github.com/acl-dev/go-master/blob/master/service.go#L269) licensed under GPL v2.1

func GetFilePacketConnByFd added in v0.3.2

func GetFilePacketConnByFd(fd int) (net.PacketConn, error)

func GetOutboundIP added in v0.3.0

func GetOutboundIP() (string, error)

Get preferred outbound ip of this machine

func HostAddress

func HostAddress(host string, port int) string

HostAddress composes a ip:port style address. Its opposite function is net.SplitHostPort.

func HostAddress2

func HostAddress2(host string, port string) string

func HostPort

func HostPort(addr string) (string, string, error)

func IPAtoi added in v0.3.2

func IPAtoi(s string) uint32

IPAtoi returns the integer format of ip string @s

func IPItoa added in v0.3.2

func IPItoa(ip uint32) string

IPItoa returns the string representation of @ip

func IsSameAddr added in v0.3.0

func IsSameAddr(a1, a2 net.Addr) bool

refers from https://github.com/facebookgo/grace/blob/master/gracenet/net.go#L180:6

func WSHostAddress

func WSHostAddress(host string, port int, path string) string

func WSHostAddress2

func WSHostAddress2(host string, port string, path string) string

func WSSHostAddress

func WSSHostAddress(host string, port int, path string) string

func WSSHostAddress2

func WSSHostAddress2(host string, port string, path string) string

Types

This section is empty.

Directories

Path Synopsis
Package gxreuseport provides a function that returns a net.Listener powered by a net.FileListener with a SO_REUSEPORT option set to the socket.
Package gxreuseport provides a function that returns a net.Listener powered by a net.FileListener with a SO_REUSEPORT option set to the socket.
2017-10-31 14:30 Package gxurl implements URL function encapsulation
2017-10-31 14:30 Package gxurl implements URL function encapsulation

Jump to

Keyboard shortcuts

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