tcptrans

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

func Accept(listener *net.TCPListener) (net.Conn, error)

func DialAddr

func DialAddr(lAddr, rAddr *net.TCPAddr) (net.Conn, error)

func DialAddress

func DialAddress(lAddress, rAddress string) (net.Conn, error)

laddress: local-address raddress: remote-address

func Listen

func Listen(addr *net.TCPAddr) (*net.TCPListener, error)

func ListenAndAccept

func ListenAndAccept(addr *net.TCPAddr) (*net.TCPListener, net.Conn, error)

func ListenAndAcceptAddress

func ListenAndAcceptAddress(address string) (*net.TCPListener, net.Conn, error)

func NewCoupleTCPAddr

func NewCoupleTCPAddr(lAddress string, dAddress string) (*net.TCPAddr, *net.TCPAddr, error)

func NewTCP4Addr

func NewTCP4Addr(address string) (*net.TCPAddr, error)

func NewTCP6Addr

func NewTCP6Addr(address string) (*net.TCPAddr, error)

func NewTCPAddr

func NewTCPAddr(address string) (*net.TCPAddr, error)

func NewTCPAddrFromIPPort

func NewTCPAddrFromIPPort(ip string, port int, zone string) *net.TCPAddr

func Telnet

func Telnet(addr string, timeout time.Duration) (bool, error)

func TelnetN

func TelnetN(addr string, times int, timeout time.Duration) (bool, error)

func TransferFromDialToDial

func TransferFromDialToDial(dAddrFrom *net.TCPAddr, dAddrTo *net.TCPAddr, keepListening bool) error

func TransferFromDialToDialAddress

func TransferFromDialToDialAddress(lAddress string, dAddress string, keepListening bool) error

func TransferFromListenToDial

func TransferFromListenToDial(lAddr *net.TCPAddr, dAddr *net.TCPAddr, keepListening bool, output *TCPTransferContext) error

func TransferFromListenToDialAddress

func TransferFromListenToDialAddress(lAddress string, dAddress string, keepListening bool, output *TCPTransferContext) error

laddress: local-address, listen-address daddress: dial-address, destination-address

func TransferFromListenToListen

func TransferFromListenToListen(lAddr *net.TCPAddr, dAddr *net.TCPAddr, keepListening bool, output *TCPTransferContext) error

func TransferFromListenToListenAddress

func TransferFromListenToListenAddress(lAddress string, dAddress string, keepListening bool, output *TCPTransferContext) error

func TransferTCP

func TransferTCP(src net.Conn, dst net.Conn, closed bool) (chan iokit.Direction, error)

func TransferTCPDynamic

func TransferTCPDynamic(srcConnFactory iokit.ConnFactoryFunc, dstConnFactory iokit.ConnFactoryFunc, closed bool) (chan iokit.Direction, error)

Types

type TCPTransferContext

type TCPTransferContext struct {
	LAddr         *net.TCPAddr
	DAddr         *net.TCPAddr
	KeepListening bool
	LListener     *net.TCPListener
	DListener     *net.TCPListener
	StopChan      *chan os.Signal
}

func BuildTransfer

func BuildTransfer(lAddress string, dAddress string, keepListening bool) (*TCPTransferContext, error)

func (TCPTransferContext) GetDListener

func (t TCPTransferContext) GetDListener() *net.TCPListener

func (TCPTransferContext) GetLListener

func (t TCPTransferContext) GetLListener() *net.TCPListener

func (TCPTransferContext) Stop

func (t TCPTransferContext) Stop()

func (TCPTransferContext) TransferFromDialToDial

func (t TCPTransferContext) TransferFromDialToDial() error

func (TCPTransferContext) TransferFromListenToDial

func (t TCPTransferContext) TransferFromListenToDial() error

func (TCPTransferContext) TransferFromListenToListen

func (t TCPTransferContext) TransferFromListenToListen() error

Jump to

Keyboard shortcuts

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