feat 优化网络库

This commit is contained in:
2026-01-03 13:19:43 +08:00
parent a565692217
commit 470f642515
19 changed files with 180 additions and 126 deletions

View File

@@ -28,9 +28,9 @@ const (
// ISocketServer 由应用层实现
type ISocketServer interface {
OnOpen(ISocketConn) ([]byte, Action) // 开启连接
OnHandShake(ISocketConn) // 开始握手
OnMessage(ISocketConn, []byte) Action // 收到消息
OnOpen(ISocketConn) ([]byte, Action) // 开启连接
OnHandShake(ISocketConn, []byte, func(ISocketConn, []byte)) Action // 开始握手
OnMessage(ISocketConn, []byte) Action // 收到消息
OnPong(ISocketConn)
OnClose(ISocketConn, error) Action // 关闭连接
OnTick() (time.Duration, Action)