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

Support setting SO_LINGER on TcpSocket #1387

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

zekisherif
Copy link
Contributor

Because tokio TcpStream and mio TcpStream now use std::net::TcpStream as the underlying stream, there isn't a way to set linger options.

I'm aware of #1381 and the dislike of duplicating features. This is the last functionality I need.

The plan is to convert the stream by calling as_raw_fd() and set the linger option.

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if you can fix the CI and the small change to the test.

tests/tcp_socket.rs Show resolved Hide resolved
@Thomasdezeeuw
Copy link
Collaborator

Thanks @zekisherif.

@zekisherif zekisherif deleted the linger branch November 6, 2020 16:52
@zekisherif
Copy link
Contributor Author

Just realized that the commit message should really be "Support getting SO_LINGER value".

The setting of the linger value is meant for tokio TcpStream not mio.

@Thomasdezeeuw
Copy link
Collaborator

I missed it too, oh well.. it's committed now.

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

Successfully merging this pull request may close these issues.

2 participants