server

package
v0.3.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTCPServer

func NewTCPServer(host string, handle func(net.Conn)) (server.Server, error)

NewTCPServer create new TCP listener

func NewUDPServer

func NewUDPServer(host string, opt ...func(u *udpOpt)) (server.Server, error)

func UDPWithHandle

func UDPWithHandle(f func(req io.Reader) (resp io.ReadCloser, err error)) func(u *udpOpt)

func UDPWithListenConfig

func UDPWithListenConfig(n net.ListenConfig) func(u *udpOpt)

func UDPWithListenFunc

func UDPWithListenFunc(f func(net.PacketConn) error) func(u *udpOpt)

Types

type EmptyServer

type EmptyServer struct{}

func (*EmptyServer) Addr

func (e *EmptyServer) Addr() net.Addr

func (*EmptyServer) Close

func (e *EmptyServer) Close() error

Jump to

Keyboard shortcuts

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