package
0.0.0-20221019053613-4d93c9d5f7da
Repository: https://github.com/xuehu96/go-tcpcat.git
Documentation: pkg.go.dev
# Functions
New 返回server实例.
NewClient 返回client实例.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
CodeFnType 功能函数类型.
OnAccept 有新客户端连接,在这里可以做限流,或者关掉conn 返回true 允许连接, 返回false直接close 可以做来源或连接数判断.
OnClose 客户端主动断开连接或被断开连接后调用.
OnFnCode 从接收到的数据解析出功能代码.
OnListen Listen成功后回调.
OnReadData 接收到客户端数据调用 返回true 继续处理数据, 返回false 丢弃数据 可以做数据包格式校验,格式不对的丢掉.
OnSendData 向客户端发送数据成功后调用,可用于发送成功通知调用方.
OnStop Listen关闭后回调, 可用于清理打开的资源,不允许阻塞.
No description provided by the author