Allow set_nodelay()
on TcpSocket
#5510
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-net
Module: tokio/net
Is your feature request related to a problem? Please describe.
It's a bit cumbersome to have to set some options on
TcpSocket
and others onTcpStream
. It would be nice to be able to set all the option onTcpSocket
instead. When using aTcpListener
this would also mean I only need to set the option once, instead of having to do it on every incoming connection.Describe the solution you'd like
Add
TcpSocket::set_nodelay()
(and the corresponding getter,TcpSocket::nodelay()
.)Describe alternatives you've considered
I know this is already possible to do by using
socket2
to set the option withSockRef::from(&tokio_tcp_socket).set_nodelay()
, but that solution is not obvious and require adding an other (direct) dependency to the project. (One also need to be careful to use a compatible version of socket2.)The text was updated successfully, but these errors were encountered: