YCP

package module
Version: v0.0.0-...-65b2be9 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: GPL-2.0 Imports: 12 Imported by: 0

README

YCP

TODO

[ ] use rtt to calculate rto [ ] determine when to send ack by unacked packets count and max ack delay time

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanMerge

func CanMerge(range1, range2 packet.AckRange) bool

func ListenPacket

func ListenPacket(session *Session)

func Merge

func Merge(range1, range2 packet.AckRange) packet.AckRange

Types

type Server

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

func NewServer

func NewServer(address string, logger ylog.ILogger) *Server

func (Server) Accept

func (server Server) Accept() *Session

func (*Server) Listen

func (server *Server) Listen() error

type Session

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

func Dial

func Dial(host string, port int, logger ylog.ILogger) (*Session, error)

func NewSession

func NewSession(conn net.PacketConn, addr net.Addr, conv uint32, logger ylog.ILogger) *Session

func (*Session) Close

func (sess *Session) Close() error

func (*Session) GetRtt

func (sess *Session) GetRtt() time.Duration

func (*Session) LocalAddr

func (sess *Session) LocalAddr() net.Addr

func (*Session) Read

func (sess *Session) Read(b []byte) (n int, err error)

func (*Session) RemoteAddr

func (sess *Session) RemoteAddr() net.Addr

func (*Session) SetDeadline

func (sess *Session) SetDeadline(t time.Time) error

func (*Session) SetLossRate

func (sess *Session) SetLossRate(loss int)

func (*Session) SetReadDeadline

func (sess *Session) SetReadDeadline(t time.Time) error

func (*Session) SetWriteDeadline

func (sess *Session) SetWriteDeadline(t time.Time) error

func (*Session) SignalAck

func (sess *Session) SignalAck()

func (*Session) SignalClose

func (sess *Session) SignalClose()

func (*Session) SignalData

func (sess *Session) SignalData()

func (*Session) SignalRead

func (sess *Session) SignalRead()

func (*Session) SignalWrite

func (sess *Session) SignalWrite()

func (*Session) String

func (sess *Session) String() string

func (*Session) Write

func (sess *Session) Write(b []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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