session

package
v0.0.0-...-014b5c3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UDP_PACKET_SIZE   = 65507
	MAX_PACKETS_QUEUE = 10000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxRequests        uint64
	MaxResponses       uint64
	ClientIdleTimeout  time.Duration
	BackendIdleTimeout time.Duration
	Transparent        bool
}

type Session

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

func NewSession

func NewSession(clientAddr *net.UDPAddr, conn net.Conn, backend core.Backend, scheduler *scheduler.Scheduler, cfg Config) *Session

func (*Session) Close

func (s *Session) Close()

func (*Session) IsDone

func (s *Session) IsDone() bool

func (*Session) ListenResponses

func (s *Session) ListenResponses(sendTo *net.UDPConn)

*

  • ListenResponses waits for responses from backend, and sends them back to client address via
  • server connection, so that client is not confused with source host:port of the
  • packet it receives

func (*Session) Write

func (s *Session) Write(buf []byte) error

Jump to

Keyboard shortcuts

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