interf

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	GetConn() net.Conn
	Close()
	IsClosed() bool

	Write(data []byte) error
	AsyncWrite(data []byte) error

	LocalAddr() net.Addr
	RemoteAddr() net.Addr

	Set(string, interface{})
	Get(string) interface{}
	Del(string)

	Run()
}

type Handler

type Handler interface {
	Init(conn Conn, ts tfi.Transform) //初始化连接和转换
	OnMessage(data []byte) error      //在该函数实现中使用 transform 进行转换,而不是放在通信代码中
	OnClose(err error)
}

Jump to

Keyboard shortcuts

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