tcp

package
Version: v0.0.0-...-f6e02f1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderEnd     = "\r\n\r\n"
	LineEnd       = "\r\n"
	ContentLength = "Content-Length:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) CompleteRead

func (c *Conn) CompleteRead(spliter func(b []byte) (int, bool), handler func(*Conn, []byte) bool) error

func (*Conn) CompleteWrite

func (c *Conn) CompleteWrite(b []byte) (err error)

func (*Conn) GetCid

func (c *Conn) GetCid() uint64

func (*Conn) IsClosed

func (c *Conn) IsClosed() bool

type Server

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

func NewServer

func NewServer() *Server

func (*Server) GetConn

func (s *Server) GetConn(cid uint64) *Conn

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(host string, port int) error

func (*Server) NewConn

func (s *Server) NewConn(conn net.Conn) *Conn

func (*Server) SetHandler

func (s *Server) SetHandler(handler func(*Conn, []byte) bool) *Server

func (*Server) SetSpliter

func (s *Server) SetSpliter(spliter func([]byte) (int, bool)) *Server

Source Files

Jump to

Keyboard shortcuts

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