transports

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BINARY_HEADER = []byte{0x36}
)

Functions

func Transports

func Transports() map[string]*transports

Types

type Jsonp

type Jsonp interface {
	Polling
}

func MakeJSONP

func MakeJSONP() Jsonp

JSON-P polling transport.

func NewJSONP

func NewJSONP(ctx *types.HttpContext) Jsonp

type Polling

type Polling interface {
	Transport

	DoWrite(*types.HttpContext, _types.BufferInterface, *packet.Options, func(*types.HttpContext))
}

func MakePolling

func MakePolling() Polling

HTTP polling New.

func NewPolling

func NewPolling(ctx *types.HttpContext) Polling

type Transport

type Transport interface {
	events.EventEmitter

	Prototype(Transport)
	Proto() Transport

	SetSid(string)
	SetWritable(bool)
	SetReq(*types.HttpContext)
	SetSupportsBinary(bool)
	SetReadyState(string)
	SetHttpCompression(*types.HttpCompression)
	SetPerMessageDeflate(*types.PerMessageDeflate)
	SetMaxHttpBufferSize(int64)

	Sid() string
	Writable() bool
	Protocol() int
	// @protected
	Discarded() bool
	// @protected
	Parser() parser.Parser
	// @protected
	Req() *types.HttpContext
	// @protected
	SupportsBinary() bool
	ReadyState() string
	HttpCompression() *types.HttpCompression
	PerMessageDeflate() *types.PerMessageDeflate
	MaxHttpBufferSize() int64
	// @abstract
	HandlesUpgrades() bool
	// @abstract
	SupportsFraming() bool
	// @abstract
	Name() string

	// Construct() should be called after calling Prototype()
	Construct(*types.HttpContext)
	// @private
	// Flags the transport as discarded.
	Discard()
	// @protected
	// Called with an incoming HTTP request.
	OnRequest(*types.HttpContext)
	// @private
	// Closes the transport.
	Close(...types.Callable)
	// @protected
	// Called with a transport error.
	OnError(string, error)
	// @protected
	// Called with parsed out a packets from the data stream.
	OnPacket(*packet.Packet)
	// @protected
	// Called with the encoded packet data.
	OnData(_types.BufferInterface)
	// @protected
	// Called upon transport close.
	OnClose()
	// @protected
	// @abstract
	// Writes a packet payload.
	Send([]*packet.Packet)
	// @protected
	// @abstract
	// Closes the transport.
	DoClose(types.Callable)
}

func MakeTransport

func MakeTransport() Transport

func NewTransport

func NewTransport(ctx *types.HttpContext) Transport

type WebTransport

type WebTransport interface {
	Transport
}

func MakeWebTransport

func MakeWebTransport() WebTransport

WebTransport transport

func NewWebTransport

func NewWebTransport(ctx *types.HttpContext) WebTransport

type Websocket

type Websocket interface {
	Transport
}

func MakeWebSocket

func MakeWebSocket() Websocket

WebSocket transport

func NewWebSocket

func NewWebSocket(ctx *types.HttpContext) Websocket

Jump to

Keyboard shortcuts

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