ztcpserver

package
v0.0.0-...-a0ddb2b Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ThreadPerConn = 5

Variables

This section is empty.

Functions

func ReadWithEnd

func ReadWithEnd(reader *bufio.Reader) ([]byte, error)

func ServerStart

func ServerStart(host string)

Types

type Command

type Command int
const (
	MessageNew Command = iota
	MessageEdit
	MessageBroadcast
)

func (Command) Name

func (s Command) Name() (name string)

func (Command) String

func (s Command) String() (name string)

func (Command) Toa

func (s Command) Toa() string

type ConnHandle

type ConnHandle struct {
	// contains filtered or unexported fields
}

func ConnHandleCreate

func ConnHandleCreate(conn net.Conn) *ConnHandle

func (*ConnHandle) Handle

func (s *ConnHandle) Handle() error

func (*ConnHandle) LoopToFlush

func (s *ConnHandle) LoopToFlush()

func (*ConnHandle) LoopToRead

func (s *ConnHandle) LoopToRead()

func (*ConnHandle) LoopToWrite

func (s *ConnHandle) LoopToWrite()

Jump to

Keyboard shortcuts

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