gxnet

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gxnet encapsulates some network functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIPValidity

func CheckIPValidity(IPString string) bool

CheckIPValidity checks whether @IPString is a valid ip

func GetFileConnByFd

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

func GetFileListenerByFd

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

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

func GetOutboundIP

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

func IPAtoi(s string) uint32

IPAtoi returns the integer format of ip string @s

func IPItoa

func IPItoa(ip uint32) string

IPItoa returns the string representation of @ip

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