Comments (4)
udp connect 其实并没什么用 只是设置下对端的地址 这样可以调用write和send函数(而不用sendto).
一个udp端口对应一个fd,所以一般只能对应一条线程。所以要提高udp的性能,一般通过多个udp端口解决。
from zltoolkit.
TcpServer中,一个tcp端口,有一个listen fd, 在收到accept事件后,能创建多个peerfd。
这个listen fd是多个线程监听的,可以多个线程同时accept,accept成功后有有一个peerfd,这个peerfd会 绑定到这条accept线程
from zltoolkit.
也就是说 tcp服务器单端口能发挥多核cpu的性能,但是udp单端口只能发挥单条线程的性能
from zltoolkit.
了解了, 多谢解答.
from zltoolkit.
Related Issues (20)
- semaphore.h名字和系统的semaphore.h冲突了 HOT 1
- ios 16及以上,socket_ios 必现崩溃,急,麻烦大佬们帮忙看下。 HOT 9
- 编译时遇到的坑 HOT 3
- BUG反馈
- sslbox mbedtls 支持 HOT 5
- 您好,请教下我将 libzltoolkit.a 和libzlmediakit.a 静态库加到项目中,编译后报错 HOT 2
- 关于SocketSender中的send 方法不用的问题。 HOT 3
- CPU占用很高,定位到这里 HOT 14
- Timer实现是否存在缺陷 HOT 7
- ThreadPool.h 中线程优先级设置问题 HOT 9
- Socket::flushData函数,多线程数据发送顺序问题 HOT 3
- 服务重新启动,客户端重连bug HOT 5
- static_pointer_cast的使用 HOT 1
- 测试发现Tcpserver运行过程中会崩溃 HOT 7
- UdpServer clone策略问题 HOT 12
- [BUG] onAccept异常出现了write事件 HOT 2
- 进程(调用Debug版版本库)退出时异常 HOT 9
- 多个线程打印同一个日志时,由于日志优化会导致写的日志不对 HOT 1
- ssl 支持多线程 问题求助 HOT 2
- Threadpool的cpu负载统计好像有问题 HOT 1
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 zltoolkit.