netutil

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package netutil implements some network utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstIP added in v0.0.5

func FirstIP(cidr *net.IPNet) net.IP

func GetOutBoundIP

func GetOutBoundIP() (net.IP, error)

GetOutBoundIP get preferred outbound ip of current process.

https://stackoverflow.com/a/37382208

func LastIP added in v0.0.5

func LastIP(cidr *net.IPNet) net.IP

Types

type JConn

type JConn struct {
	// contains filtered or unexported fields
}

func NewJConn

func NewJConn(conn net.Conn) (jconn *JConn, err error)

func (*JConn) Accept

func (jconn *JConn) Accept(v interface{}) (err error)

func (*JConn) Close

func (jconn *JConn) Close() (err error)

Close only close gzip.Reader/gzip.Writer. Source net.Conn should be closed manually.

func (*JConn) Send

func (jconn *JConn) Send(v interface{}) (err error)

Jump to

Keyboard shortcuts

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