server

package
v0.3.1-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 9 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), opt ...func(*tcpOpt)) (server.Server, error)

NewTCPServer create new TCP listener

func NewUDPServer

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

func TCPWithListenConfig

func TCPWithListenConfig(n net.ListenConfig) func(u *tcpOpt)

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