kcphttp

package
v0.0.0-...-aaf6028 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Out-of-Order HTTP-like protocol with keepalive messages/heartbeat. Useful for use with KCP.

Index

Constants

This section is empty.

Variables

View Source
var ETimeout = errors.New("deadline timeout")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(Dial func() (net.Conn, error)) *Client

func (*Client) Destroy

func (c *Client) Destroy()

func (*Client) DoDeadline

func (c *Client) DoDeadline(req *fasthttp.Request, resp *fasthttp.Response, deadline time.Time) error

type Server

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

func NewServer

func NewServer(hn fasthttp.RequestHandler) *Server

func (*Server) Handle

func (sr *Server) Handle(c net.Conn)

type WIQueue

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

func NewWIQueue

func NewWIQueue() *WIQueue

func (*WIQueue) EvictAll

func (w *WIQueue) EvictAll()

func (*WIQueue) EvictExpired

func (w *WIQueue) EvictExpired()

func (*WIQueue) Get

func (w *WIQueue) Get(ni uint64) *WorkItem

func (*WIQueue) Push

func (w *WIQueue) Push(wi *WorkItem) uint64

type WorkItem

type WorkItem struct {
	WG   sync.WaitGroup
	Req  *fasthttp.Request
	Resp *fasthttp.Response
	Dead time.Time
	Err  error
}

Jump to

Keyboard shortcuts

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