evio

Posted by 夏泽民

https://github.com/tidwall/evio https://github.com/Allenxuxu/eviop/ https://github.com/Allenxuxu/gev 最近翻了 evio 的源码,发现一些问题,主要集中在 linux 平台 epoll 上和读写的处理。



golang调用原生epoll引起event loop阻塞问题

Posted by 夏泽民

http://xiaorui.cc/archives/6758 https://github.com/panjf2000/gnet golang标准库net很优秀,可以让开发者轻易构建非阻塞网络服务,但开发爽快带来的问题协程数加大,比如在net/http里一个连接两个协程,grpc算是业务和keepalive心跳是四个协程,数据的进出是通过channel传输。



websocket

Posted by 夏泽民

https://www.gorillatoolkit.org/pkg/websocket Overview The Conn type represents a WebSocket connection. A server application calls the Upgrader.Upgrade method from an HTTP request handler to get a *Conn: 使用Go语言创建WebSocket服务 今天介绍如何用Go语言创建WebSocket服务,文章的前两部分简要介绍了WebSocket协议以及用Go标准库如何创建WebSocket服务。第三部分实践环节我们使用了gorilla/websocket库帮助我们快速构建WebSocket服务,它帮封装了使用Go标准库实现WebSocket服务相关的基础逻辑,让我们能从繁琐的底层代码中解脱出来,根据业务需求快速构建WebSocket服务。



linux的wc -l 命令统计文件少一行

Posted by 夏泽民

wc(Word Count)命令的功能为统计指定文件中的字节数、字数、行数,并将统计结果显示输出



Understand unsafe in GoLang

Posted by 夏泽民

https://www.pixelstech.net/article/1584241521-Understand-unsafe-in-GoLang before going to understand unsafe package in GoLang, the first thing needs to talk about is the pointer in GoLang. If you have a background of C language, you must know what pointer means and its usage. With pointer, you are free to operate any data at memory level which means you have great power, but this means that you have great responsibility as well. That’s why it might be considered unsafe in lots of cases. ake a look at a simple example of doubling an integer.



Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required