entry

package
v0.0.0-...-36d655e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StopError = errors.New("listener stopped")

Functions

This section is empty.

Types

type Entrance

type Entrance interface {
	ListenAndServe() error
	Stop()
}

type HttpEntry

type HttpEntry struct {
	Host         string
	Port         int
	MaxSize      int
	Server       *http.Server
	StopListener *StopListener
	MessageQueue queue.MessageQueue
}

func NewHttpEntry

func NewHttpEntry(host string, port int, messageQueue queue.MessageQueue) (*HttpEntry, error)

func (*HttpEntry) ListenAndServe

func (h *HttpEntry) ListenAndServe() error

func (*HttpEntry) Stop

func (h *HttpEntry) Stop()

type StopListener

type StopListener struct {
	*net.TCPListener // 包装的 TCP 监听器
	// contains filtered or unexported fields
}

StopListener 包装了 net.TCPListener,用于在需要时停止监听

func NewStopListener

func NewStopListener(l net.Listener) (*StopListener, error)

func (*StopListener) Accept

func (sl *StopListener) Accept() (net.Conn, error)

func (*StopListener) Stop

func (sl *StopListener) Stop()

Jump to

Keyboard shortcuts

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