Comments (4)
gopher实现的相关疑惑:
gopher_unix.go/L36:for j := 0; j < len(g.lfds); j++ {}多余的吗?没有看到lfds的初始化或其他使用
gopher_std.go/L22:g.lfds = []int{}也是类似的
from nbio.
是的,应该是早期实现的时候 windows 和 uni* 差别,后来整理了没那么细,但是只有windows上面重复了,而且没什么影响,uni*没有第二次make:
https://github.com/lesismal/nbio/blob/master/gopher_unix.go#L23
并且这种make后没使用的内存不会真正分配内存
我把windows重复的这句去掉,感谢反馈!
from nbio.
gopher实现的相关疑惑: gopher_unix.go/L36:for j := 0; j < len(g.lfds); j++ {}多余的吗?没有看到lfds的初始化或其他使用 gopher_std.go/L22:g.lfds = []int{}也是类似的
应该是多余的,最早时候是用的 syscall,单个 epoll 单个 goroutine 处理多个 listener fd 的,后来改成直接用标准库了,清理的时候漏掉了、遗留下的,不影响使用。
难得有人来阅读代码,有兴趣欢迎来 pr 一下、多多指正一些
from nbio.
这个可以先关闭了吗?
from nbio.
Related Issues (20)
- Upgrader 是否可复用? HOT 3
- Invalid WebSocket frame: invalid UTF-8 sequence HOT 5
- how to proxy via nginx, i need to use SSL(wss) HOT 3
- 对标netty的nio吗? HOT 2
- 請教關於TLS websocket的連線問題 HOT 7
- Write errors after 65k web socket connections writing every 2 sec HOT 7
- 请问,这个库对每个用户的websocket连接是单独开启一个协程吗? HOT 15
- 请教下,这个库可以进行TLS双向验证吗? HOT 3
- 请教 在OnData中做一个并发安全的疑惑 HOT 1
- tcp raw 有没有办法只保留部分数据,其他数据不进缓冲区 HOT 10
- 你好大佬,看了你的方法,有一点建议,不知道合理不合理,希望你能看到,给个回复 HOT 17
- 大佬,很感谢分享,我在使用的时候有一些问题,是否可以请教下 HOT 6
- 大老您好,请教下和fasthttp的结合 HOT 7
- How to use proxy for websocket connection HOT 5
- Can this library be used as a websocket client? HOT 6
- 向大佬求助,如何用这个库写出生产者和消费者的代码结构? HOT 35
- [advice]建议再多一层上层的封装(独立一个package,依赖这个库) HOT 4
- How to run a worker that sends ping/pong as a text message like pingHandler and pongHandler upgrader HOT 15
- 请问多个包合并读取应该如何处理? HOT 3
- How to check that websocket conn is open or closed? can we export the internal variable of isClosed? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbio.