rftp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package rftp implements the RFT-Protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUDPConnection

func NewUDPConnection() *udpConnection

Types

type Client

type Client struct {
	Conn connection
	// contains filtered or unexported fields
}

func (*Client) Request

func (c *Client) Request(host string, files []string) ([]*FileResponse, error)

type CloseConnectionReason

type CloseConnectionReason uint16

func (CloseConnectionReason) String

func (m CloseConnectionReason) String() string

type FileHandler

type FileHandler func(name string) (*io.SectionReader, error)

type FileResponse

type FileResponse struct {
	Name string

	Err error
	// contains filtered or unexported fields
}

func Request

func Request(host string, files []string) ([]*FileResponse, error)

func (*FileResponse) Read

func (f *FileResponse) Read(p []byte) (n int, err error)

func (*FileResponse) Size

func (f *FileResponse) Size() uint64

type LossSimulator

type LossSimulator interface {
	// contains filtered or unexported methods
}

func NewMarkovLossSimulator

func NewMarkovLossSimulator(p float32, q float32) LossSimulator

Return a new loss simulator. p and q between 0 and 1. Caller should consider seeding global randomness source.

type MarkovLossSimulator

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

type MetaDataStatus

type MetaDataStatus uint8

status, the server puts to metadata

func (MetaDataStatus) String

func (m MetaDataStatus) String() string

type NoopLossSimulator

type NoopLossSimulator struct{}

type RateControl

type RateControl interface {
	// contains filtered or unexported methods
}

type Server

type Server struct {
	Conn connection
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Listen

func (s *Server) Listen(host string) error

func (*Server) SetFileHandler

func (s *Server) SetFileHandler(fh FileHandler)

Jump to

Keyboard shortcuts

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