transfer

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveHandler

type ActiveHandler struct {
	RemoteAddr *net.TCPAddr // remote address of the client
	// contains filtered or unexported fields
}

ActiveHandler handles active connection.

func (*ActiveHandler) Close

func (a *ActiveHandler) Close() error

Close closes only if connection is established.

func (*ActiveHandler) Open

func (a *ActiveHandler) Open() (net.Conn, error)

Open opens connection.

type Handler

type Handler interface {
	// Get the connection to transfer data on.
	Open() (net.Conn, error)

	// Close the connection (and any associated resource).
	Close() error
}

Handler presents active/passive transfer connection handler.

type PassiveHandler

type PassiveHandler struct {
	TCPListener *net.TCPListener // TCP Listener (only keeping it to define a deadline during the accept)
	Listener    net.Listener     // TCP or SSL Listener
	Port        int              // TCP Port we are listening on
	// contains filtered or unexported fields
}

PassiveHandler handles passive connection.

func (*PassiveHandler) Close

func (p *PassiveHandler) Close() error

Close only the client connection is not supported at that time.

func (*PassiveHandler) ConnectionWait

func (p *PassiveHandler) ConnectionWait(wait time.Duration) (net.Conn, error)

ConnectionWait wait for connection time out

func (*PassiveHandler) Open

func (p *PassiveHandler) Open() (net.Conn, error)

Open opens connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL