transports

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONP

func NewJSONP(ctx *types.HttpContext) *jsonp

JSON-P polling transport.

func NewPolling

func NewPolling(ctx *types.HttpContext) *polling

HTTP polling New.

func NewTransport

func NewTransport(ctx *types.HttpContext) *transport

func NewWebSocket

func NewWebSocket(ctx *types.HttpContext) *websocket

WebSocket transport

func Transports

func Transports() map[string]*transports

Types

type Transport

type Transport interface {
	events.EventEmitter

	SetSid(string)
	SetSupportsBinary(bool)
	SetMaxHttpBufferSize(int64)
	SetGttpCompression(*types.HttpCompression)
	SetPerMessageDeflate(*types.PerMessageDeflate)
	SetReadyState(string)

	Parser() parser.Parser
	Sid() string
	Protocol() int
	Name() string
	SupportsFraming() bool
	HandlesUpgrades() bool
	MaxHttpBufferSize() int64
	HttpCompression() *types.HttpCompression
	PerMessageDeflate() *types.PerMessageDeflate
	ReadyState() string
	Writable() bool

	// Flags the transport as discarded.
	Discard()

	// Called with an incoming HTTP request.
	OnRequest(*types.HttpContext)

	// Closes the transport.
	DoClose(types.Callable)

	// Called with a transport error.
	OnError(string, ...string)

	// Called with parsed out a packets from the data stream.
	OnPacket(*packet.Packet)

	// Called with the encoded packet data.
	OnData(types.BufferInterface)

	// Called upon transport close.
	OnClose()

	// Writes a packet payload.
	Send([]*packet.Packet)

	// Closes the transport.
	Close(...types.Callable)
}

Jump to

Keyboard shortcuts

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