上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 70 下一页
摘要: ## responseUse response中间件,在Bind()之前执行。可以对response进行通用逻辑处理。 如果只需要闭包逻辑,则可以使用`WithResponseMiddlerFunc`,而不必创建一个结构体,下面的例子中对两种方法都进行了使用。 ```go import ( "byt 阅读全文
posted @ 2023-07-27 11:51 codestacklinuxer 阅读(28) 评论(0) 推荐(0)
摘要: 国内网络访问国外资源经常会出现不稳定的情况,目前需要搭建CDN代理,目前有 # 启用 Go Modules 功能 go env -w GO111MODULE=on # 配置 GOPROXY 环境变量,以下三选一 # 1. 七牛 CDN go env -w GOPROXY=https://goprox 阅读全文
posted @ 2023-07-25 16:17 codestacklinuxer 阅读(19) 评论(0) 推荐(0)
摘要: 断言 // 目的是检查 *QueryEncode 类型是否满足了 Adder 接口。 // 在这里,Adder 是一个接口类型,QueryEncode 是一个具体的类型。QueryEncode 类型是否实现了add 接口 var _ Adder = (*QueryEncode)(nil) 反射 x 阅读全文
posted @ 2023-07-14 11:20 codestacklinuxer 阅读(41) 评论(0) 推荐(0)
摘要: 目前使用net/http 长连接 连接池复用时,出现连接一直都在关闭重连, strace 后发现没有read respone 只读取了head,但是body没有读取, google后看到官方问题,确实记录需要代码实现读取body逻辑来清空socket内核缓存,以便后面复用。 需要读取respone里 阅读全文
posted @ 2023-07-13 16:03 codestacklinuxer 阅读(275) 评论(0) 推荐(1)
摘要: 4.2. Algorithm Organization The BBR algorithm is an event-driven algorithm that executes steps upon the following events: connection initialization, u 阅读全文
posted @ 2023-07-02 16:41 codestacklinuxer 阅读(147) 评论(0) 推荐(0)
摘要: brr 算法流程: bbr算是一个完全独立的拥塞算法,具有自己的拥塞状态机.tcp_cong_control函数已经被bbr_main函数接管了 static void tcp_cong_control(struct sock *sk, u32 ack, u32 acked_sacked, int 阅读全文
posted @ 2023-06-27 20:28 codestacklinuxer 阅读(461) 评论(0) 推荐(0)
摘要: Initialization Steps Upon transport connection initialization, BBR executes the following steps: BBRInit(): init_windowed_max_filter(filter=BBR.BtlBwF 阅读全文
posted @ 2023-06-26 17:26 codestacklinuxer 阅读(120) 评论(0) 推荐(0)
摘要: **Network Path Model** BBR is a model-based congestion control algorithm: its behavior is based on an explicit model of the network path over which a 阅读全文
posted @ 2023-06-26 11:28 codestacklinuxer 阅读(143) 评论(0) 推荐(0)
摘要: 在查看google的BBR算法时,里面出现了一个 startup gain的推到过程: For simplicity, let RTT=1 unit of time. For smooth traffic to avoid queue pressure, we want the sending ra 阅读全文
posted @ 2023-06-20 20:18 codestacklinuxer 阅读(74) 评论(0) 推荐(0)
摘要: 注意: “_”是特殊标识符,用来忽略结果。 iota是go语言的常量计数器,只能在常量的表达式中使用。 iota在const关键字出现时将被重置为0。const中每新增一行常量声明将使iota计数一次(iota可理解为const语句块中的行索引) slice 并不是数组或数组指针。它通过内部指针和相 阅读全文
posted @ 2023-05-20 23:38 codestacklinuxer 阅读(51) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 70 下一页