Giter VIP home page Giter VIP logo

Comments (4)

xia-chu avatar xia-chu commented on May 22, 2024

udp connect 其实并没什么用 只是设置下对端的地址 这样可以调用write和send函数(而不用sendto).

一个udp端口对应一个fd,所以一般只能对应一条线程。所以要提高udp的性能,一般通过多个udp端口解决。

from zltoolkit.

xia-chu avatar xia-chu commented on May 22, 2024

TcpServer中,一个tcp端口,有一个listen fd, 在收到accept事件后,能创建多个peerfd。
这个listen fd是多个线程监听的,可以多个线程同时accept,accept成功后有有一个peerfd,这个peerfd会 绑定到这条accept线程

from zltoolkit.

xia-chu avatar xia-chu commented on May 22, 2024

也就是说 tcp服务器单端口能发挥多核cpu的性能,但是udp单端口只能发挥单条线程的性能

from zltoolkit.

wasphin avatar wasphin commented on May 22, 2024

了解了, 多谢解答.

from zltoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.