socket

package
v3.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler()

func RegisterTransport

func RegisterTransport()

Types

type Handler

type Handler struct {
	Service  *core.Service
	Pool     core.WorkerPool
	OnAccept func(net.Conn) net.Conn
	OnClose  func(net.Conn)
	OnError  func(net.Conn, error)
}

func (*Handler) BindContext

func (h *Handler) BindContext(ctx context.Context, server core.Server)

BindContext to the http server.

func (*Handler) Serve

func (h *Handler) Serve(ctx context.Context, conn net.Conn)

type Transport

type Transport struct {
	OnConnect func(net.Conn) net.Conn
	OnClose   func(net.Conn)
	// contains filtered or unexported fields
}

func (*Transport) Abort

func (trans *Transport) Abort()

func (*Transport) Transport

func (trans *Transport) Transport(ctx context.Context, request []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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