Documentation ¶
Index ¶
- func CheckPort(protocol string, addr string) bool
- func ConnCheck(conn net.Conn) error
- func DiscoverDNS(service, proto string, address string) ([]*net.SRV, error)
- func GetLocalIP() string
- func GetPort(addrOrNet interface{}) (int, error)
- func Listen(address string, opts ...SockOpt) (_ net.Listener, err error)
- func ListenPacket(address string, opts ...SockOpt) (_ net.PacketConn, err error)
- func MustGetPort(addrOrNet interface{}) int
- func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error)
- type SockOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverDNS ¶
DiscoverDNS ...
func GetLocalIP ¶
func GetLocalIP() string
func ListenPacket ¶
func ListenPacket(address string, opts ...SockOpt) (_ net.PacketConn, err error)
func MustGetPort ¶
func MustGetPort(addrOrNet interface{}) int
Types ¶
type SockOpt ¶
type SockOpt func(opts *sockOpts) error
SockOpt sets up socket file's creating option
func WithNetCfg ¶
func WithNetCfg(fn func(lc *net.ListenConfig)) SockOpt
Click to show internal directories.
Click to hide internal directories.