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

net: documentation for SetLinger() is misleading #7979

Closed
gopherbot opened this issue May 12, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@gopherbot
Copy link

commented May 12, 2014

by garrett@damore.org:

The documentation for tcp.SetLinger() says;

If sec < 0 (the default), Close returns immediately and the operating system finishes
sending the data in the background.

This seems to make a promise which is rarely true.  Indeed, it seems that the
expectation is that if the operating system supports this it works, but the operating
systems I've seen don't do this.

Instead, the Close() behavior seems to be that the operating system may discard unset
data.  And indeed that's what I've seen.  I recommend the wording be changed to say:

If sec < 0; Close returns immediately.  The operating system may attempt to continue
to send data in the background, or the unset or unacknowledged data may be discarded.
@rsc

This comment has been minimized.

Copy link
Contributor

commented May 21, 2014

Comment 1:

If you have concrete evidence about the claim being false, please let me know. The
report is too vague to support changing the docs. You might also want to read
golang.org/s/linger.

Status changed to WaitingForReply.

@rsc

This comment has been minimized.

Copy link
Contributor

commented May 21, 2014

Comment 2:

Labels changed: added release-none.

@mikioh

This comment has been minimized.

Copy link
Contributor

commented May 23, 2014

Comment 3:

Status changed to Duplicate.

Merged into issue #7974.

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.