Documentation
¶
Overview ¶
Package gxnet encapsulates some network functions
Index ¶
- func CheckIPValidity(IPString string) bool
- func GetFileConnByFd(fd int) (net.Conn, error)
- func GetFileListenerByFd(fd int) (net.Listener, error)
- func GetFilePacketConnByFd(fd int) (net.PacketConn, error)
- func GetLocalIP() (string, error)
- func GetOutboundIP() (string, error)
- func HostAddress(host string, port int) string
- func HostAddress2(host string, port string) string
- func HostPort(addr string) (string, string, error)
- func IPAtoi(s string) uint32
- func IPItoa(ip uint32) string
- func IsSameAddr(a1, a2 net.Addr) bool
- func WSHostAddress(host string, port int, path string) string
- func WSHostAddress2(host string, port string, path string) string
- func WSSHostAddress(host string, port int, path string) string
- func WSSHostAddress2(host string, port string, path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIPValidity ¶ added in v0.3.2
CheckIPValidity checks whether @IPString is a valid ip
func GetFileListenerByFd ¶ added in v0.3.2
!!!: 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 GetLocalIP ¶
ref: https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go
func GetOutboundIP ¶ added in v0.3.0
Get preferred outbound ip of this machine
func HostAddress ¶
HostAddress composes a ip:port style address. Its opposite function is net.SplitHostPort.
func HostAddress2 ¶
func IsSameAddr ¶ added in v0.3.0
refers from https://github.com/facebookgo/grace/blob/master/gracenet/net.go#L180:6
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 |
Click to show internal directories.
Click to hide internal directories.