GithubHelp home page GithubHelp logo

Support TCP Fast Open about socket2 HOT 10 OPEN

rust-lang avatar rust-lang commented on July 21, 2024 6
Support TCP Fast Open

from socket2.

Comments (10)

zonyitoo avatar zonyitoo commented on July 21, 2024 1

Well, setting the TCP_FASTOPEN flag could be in socket2, but the whole TFO process (client making connection, server setting up acceptor socket) may have to be put in tokio-tfo.

I am ok to make a PR for setting TCP_FASTOPEN for sockets.

from socket2.

alexcrichton avatar alexcrichton commented on July 21, 2024

I don't know much about this myself, but PRs are most welcome to explore the design space here!

from socket2.

Thomasdezeeuw avatar Thomasdezeeuw commented on July 21, 2024

@zonyitoo still interested in contributing this?

from socket2.

zonyitoo avatar zonyitoo commented on July 21, 2024

I made a few steps but couldn't find a good design for it.

from socket2.

Thomasdezeeuw avatar Thomasdezeeuw commented on July 21, 2024

We could just expose the system calls/flags if we can't get a nice cross-platform API.

from socket2.

zonyitoo avatar zonyitoo commented on July 21, 2024

https://github.com/zonyitoo/tokio-tfo

Made a simple repo for this.

from socket2.

Thomasdezeeuw avatar Thomasdezeeuw commented on July 21, 2024

@zonyitoo do you still think this should go into Socket2? Or is your library a better place to keep it?

from socket2.

Thomasdezeeuw avatar Thomasdezeeuw commented on July 21, 2024

Well, setting the TCP_FASTOPEN flag could be in socket2, but the whole TFO process (client making connection, server setting up acceptor socket) may have to be put in tokio-tfo.

I am ok to make a PR for setting TCP_FASTOPEN for sockets.

Sounds good.

from socket2.

zonyitoo avatar zonyitoo commented on July 21, 2024

https://github.com/zonyitoo/tokio-tfo/blob/3e23d00c4258884db73cba49753fa37f5f9fa7ca/src/sys/unix/linux.rs#L388-L419

There is a problem about how to design an unified API. Linux's TCP_FASTOPEN accepts an integer value reprecenting the length of TFO accept queue. On the other platforms, including Windows, macOS, FreeBSD, it is only a switch with 0 and 1.

from socket2.

Thomasdezeeuw avatar Thomasdezeeuw commented on July 21, 2024

We could document the behaviour, i.e. 0 disables, >= 1 enables, on Linux it changes the queue length.

from socket2.

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.