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

conn.SetReadTimeout, conn.ReadFromUDP, should be os.EAGAIN, isn't #442

Closed
snarglebritchet opened this issue Dec 17, 2009 · 3 comments
Closed

Comments

@snarglebritchet
Copy link

What steps will reproduce the problem?

0. addr, err = net.ResolveUDPAddr("0.0.0.0:9876")
1. conn, err = net.ListenUDP("udp", addr)
2. conn.SetReadTimeout(10000)
3. n, peer, err = conn.ReadFromUDP(mem)

What is the expected output?

err == os.EAGAIN
err.String() == "resource temporarily unavailable"

The docs say: "ReadFromUDP can be made to time out and return err == 
os.EAGAIN after a fixed time limit; see SetTimeout and SetReadTimeout."

What do you see instead?

err != os.EAGAIN
err.String() == "recvfrom udp:[::]:9876->: resource temporarily 
unavailable"

What is your $GOOS? linux  $GOARCH? 386

Which revision are you using?  (hg identify)

28cb094e4ff1 tip
@rsc
Copy link
Contributor

rsc commented Dec 17, 2009

Comment 1:

I'm not sure but I think maybe the docs are just wrong.
You can take apart the net.OpError and look for the
EAGAIN inside.
See net/timeout_test.go

Owner changed to r...@golang.org.

Status changed to Accepted.

@snarglebritchet
Copy link
Author

Comment 2:

It doesn't seem to be a net.OpError but rather an os.PathError (oddly enough).

@rsc
Copy link
Contributor

rsc commented Apr 27, 2010

Comment 3:

This issue was closed by revision 47a0533.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants