transfer

package
v0.0.0-...-70491fa Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefualtTransfer = "tcp"

Functions

func DumpTransfers

func DumpTransfers() (s string)

func RegisterTransfer

func RegisterTransfer(name string, f func() Transfer) interface{}

Types

type OnRead

type OnRead func([]byte, I.BufferedConn) (int, error)

type TcpTransfer

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

func (*TcpTransfer) Dial

func (this *TcpTransfer) Dial(address string) (conn net.Conn, err error)

func (*TcpTransfer) Listen

func (this *TcpTransfer) Listen(address string, f OnRead) (err error)

type Transfer

type Transfer interface {
	Listen(address string, f OnRead) error
	Dial(address string) (net.Conn, error)
}

func CreateTransfer

func CreateTransfer(name string) Transfer

type WriteBufferedConn

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

func NewWriteBufferedConn

func NewWriteBufferedConn(c net.Conn, size int) *WriteBufferedConn

func (*WriteBufferedConn) Close

func (this *WriteBufferedConn) Close() error

func (*WriteBufferedConn) Flush

func (this *WriteBufferedConn) Flush() error

func (*WriteBufferedConn) LocalAddr

func (this *WriteBufferedConn) LocalAddr() net.Addr

func (*WriteBufferedConn) Read

func (this *WriteBufferedConn) Read(b []byte) (n int, err error)

func (*WriteBufferedConn) RemoteAddr

func (this *WriteBufferedConn) RemoteAddr() net.Addr

func (*WriteBufferedConn) SetDeadline

func (this *WriteBufferedConn) SetDeadline(t time.Time) error

func (*WriteBufferedConn) SetReadDeadline

func (this *WriteBufferedConn) SetReadDeadline(t time.Time) error

func (*WriteBufferedConn) SetWriteDeadline

func (this *WriteBufferedConn) SetWriteDeadline(t time.Time) error

func (*WriteBufferedConn) Write

func (this *WriteBufferedConn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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