ikilobyte / netman Goto Github PK
View Code? Open in Web Editor NEW高性能轻量级TCP、UDP框架、支持TLS、路由、中间件、WebSocket、事件循环(epoll),百万连接(C1000K)
License: MIT License
高性能轻量级TCP、UDP框架、支持TLS、路由、中间件、WebSocket、事件循环(epoll),百万连接(C1000K)
License: MIT License
RT
不用docker那种
看到example的tls只有两个(server.crt server.key)传入参数,但是不是所有证书形式都是文件。希望可以加入server.withTLSconfig(*tls.config)函数
由于是阻塞模式、直接使用标准库的tls handshak,并且后续暂时也没有把后续都改为非阻塞,所以tls模式下,每个连接仍然是阻塞的慢操作,并且tls的握手流程本身就多步骤,这对于连接数稍微多一些的服务,公网或者慢连接很容易就会遇到half-packet、连接质量不佳时,部分连接会导致其他连接都等待,这是不能接受的
提供异步非阻塞接口的框架,关键在于实现nonblock+异步流解析器,之前有个老外的ws百万连接,使用easy go,也是跟netman现在处理tls的方式类似,只是把fd的事件用poller管理起来了,并没有使用非阻塞、实现异步流解析器,这种都是不太能满足高并发、高性能服务器的需要的
ps,因为我自己也写了一个nbio,所以对这种同类项目都比较关注,欢迎多多交流
baseconnect.go这个文件中
_```
// Read 读取数据
func (c *BaseConnect) Read(bs []byte) (int, error) {
n, err := unix.Read(c.fd, bs)
// 已完成了TLS握手
if c.handshakeCompleted {
if n >= 0 {
c.tlsRawSize += n
}
}
想问下,if c.handshakeCompleted后计算收到的业务数据长度。有没有一种可能性,就是在握手结束时最后一次Read会读取部分业务数据?
请问支持udp服务吗
if eventFd == a.eventfd {
_, _ = unix.Read(eventFd, a.eventbuff)
a.Close()
return nil
}
就是这个地方,小白有些没看懂
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.