上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 70 下一页
摘要: 不要通过共享内存来通信,而应该通过通信来共享内存 这个是golang社区的经典语 说的是什么意思呢? 之前使用C代码进行性能优化的时候,遇到了很多高性能的架构,但是其只依赖于高性能的MPSC队列(queue普遍使用的原子锁,offset,count都使用CAS操作),而从来不在事务逻辑里用锁 那应该 阅读全文
posted @ 2024-01-22 14:49 codestacklinuxer 阅读(42) 评论(0) 推荐(0)
摘要: net/http 中同时包好了 HTTP 客户端和服务端的实现,为了支持更好的扩展性,它引入了 net/http.RoundTripper 和 net/http.Handler 两个接口。net/http.RoundTripper 是用来表示执行 HTTP 请求的接口,调用方将请求作为参数可以获取请 阅读全文
posted @ 2024-01-21 15:24 codestacklinuxer 阅读(158) 评论(0) 推荐(0)
摘要: 目前知道gin是基于net/http进一步封装,来看下net/http是怎样写web的 package main import ( "fmt" "net/http" ) func index(w http.ResponseWriter, r *http.Request) { fmt.Fprintln 阅读全文
posted @ 2024-01-20 21:27 codestacklinuxer 阅读(81) 评论(0) 推荐(0)
摘要: package main import ( "net/http" "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/", func(c *gin.Context) { c.String(200, "Hello! 阅读全文
posted @ 2024-01-20 17:53 codestacklinuxer 阅读(84) 评论(0) 推荐(0)
摘要: 切换了一下go env -w GOPROXY="https://goproxy.cn,direct" proxy go mod tidy 就好了 可能是aliyun代理上缺少什么东西把 !!!!!!!!!!!! 阅读全文
posted @ 2024-01-19 23:26 codestacklinuxer 阅读(370) 评论(0) 推荐(0)
摘要: TCP Tail Loss Probe(TLP) Early Retransmit机制解决了dupack较少,无法触发快速重传的问题。但是如果发生了尾丢包,由于尾包后面没有更多的数据包,也就没有办法触发任何的dupack。为解决这种尾丢包的问题,Google的几位大神提出了TLP算法。通过TLP算法 阅读全文
posted @ 2024-01-18 19:24 codestacklinuxer 阅读(226) 评论(0) 推荐(0)
摘要: UDP 在多网卡的情况下,可能会发生服务器端回复报文源地址不对的情况。目前这种情况在portal 对接ac的时候经常出现 所以问题就是:需要保存本次udp 请求的local ip remote ip IP_PKTINFO 这个选项就是让内核在 socket 中保存 IP 报文的信息,当然也包括了报文 阅读全文
posted @ 2024-01-17 15:17 codestacklinuxer 阅读(672) 评论(0) 推荐(0)
摘要: Macvlan vs Bridge The macvlan is a trivial bridge that doesn’t need to do learning as it knows every mac address it can receive, so it doesn’t need to 阅读全文
posted @ 2024-01-17 11:34 codestacklinuxer 阅读(53) 评论(0) 推荐(0)
摘要: 目前在写radius 相关c代码的时候,整理了一份基本逻辑 1、初始化log,读取系统配置文件, message sql_gorm { required uint32 db_count = 1[default=10]; required uint32 db_point = 2[default=2]; 阅读全文
posted @ 2024-01-14 20:09 codestacklinuxer 阅读(22) 评论(0) 推荐(0)
摘要: 之前浏览protobuf-c相关代码的时候,根据如下 protobuf_c_message_pack protobuf_c_message_pack_to_bufferprotobuf_c_message_unpack protobuf_c_message_free_unpacked 函数的实现,写 阅读全文
posted @ 2024-01-14 19:38 codestacklinuxer 阅读(25) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 70 下一页