Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Support TCP_FASTOPEN #638

Closed
zonyitoo opened this issue Jul 28, 2017 · 6 comments
Closed

Linux: Support TCP_FASTOPEN #638

zonyitoo opened this issue Jul 28, 2017 · 6 comments

Comments

@zonyitoo
Copy link
Contributor

TCP_FASTOPEN requires to replace read and write syscalls to sendto and recvfrom.

I propose to modify the TcpStream and TcpListener in sys::unix like this:

pub enum TcpStream {
    // TCP_FASTOPEN requires this SocketAddr to be passed into sendto and recvfrom
    FastOpen(net::TcpStream, SocketAddr),
    Default(net::TcpStream),
}
@carllerche
Copy link
Member

You can use fast open right now w/o mio by managing this state yourself. The goal of Mio is to stay minimal. Could you explain why you think Mio should apply this change?

@zonyitoo
Copy link
Contributor Author

zonyitoo commented Jul 28, 2017

Well, the Read and Write traits that implemented for TcpStream will call read and write. And the other crates, like tokio, will call Read::read and Write::write in their code. So if I want to use fastopen in my project with tokio, TcpStream in Mio must support reading and writing with sendto and recvfrom.

@zonyitoo
Copy link
Contributor Author

What's your opinion? @carllerche

@carllerche
Copy link
Member

Maybe this should be experimented with first out of crate. I don't think anything in mio/ tokio prevents a tcp-fast-open crate from existing?

@carllerche
Copy link
Member

Related to #268

@carllerche
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants