connector

package
v0.0.0-...-bf94cd9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompressConn

func NewCompressConn(conn net.Conn, compressType CompressType) net.Conn

func SocketConnector

func SocketConnector(ip string, port int)

*

  • 监听客户端连接

func WebsocketConnector

func WebsocketConnector(ip string, port int)

func WebsocketHandleClient

func WebsocketHandleClient(wsconn *websocket.Conn)

*

  • 处理客户端连接

Types

type CompressConn

type CompressConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*CompressConn) Close

func (c *CompressConn) Close() error

func (*CompressConn) Read

func (c *CompressConn) Read(b []byte) (n int, err error)

func (*CompressConn) Write

func (c *CompressConn) Write(b []byte) (n int, err error)

type CompressType

type CompressType byte
const (
	// CompressNone represents no compression
	CompressNone CompressType = iota
	// CompressFlate represents zip
	CompressFlate
	// CompressSnappy represents snappy
	CompressSnappy
)

Jump to

Keyboard shortcuts

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