package tcp import ( "context" "net" ) // Handler 业务逻辑处理接口 // 当客户端连接建立时,会调用该接口的Handle方法 // 当客户端连接断开时,会调用该接口的Close方法 type Handler interface { Handle(ctx context.Context, conn net.Conn) Close() error }