You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
func main()
{
conn, _ := net.ListenPacket("udp", "0.0.0.0:1234");
conn.SetReadTimeout(10000000e6);
fmt.Printf("waiting.. %s\n", conn.LocalAddr().String());
var buf [100]byte;
for {
n, _, err := conn.ReadFrom(&buf);
if err == os.EAGAIN {
fmt.Printf("EAGAIN\n");
continue;
}
fmt.Printf("got %d bytes\n", n);
}
}
What is the expected output? What do you see instead?
According to the doc, SetReadTimeout influences ReadFrom.
The default is zero, which means that the call must block.
Instead it immediately returns EAGAIN, regardless of SetReadTimeout.
This happens because the socket is always set up
in NONBLOCK mode.
What is your $GOOS? $GOARCH?
linux/686
Which revision are you sync'ed to? (hg log -l 1)
changeset: 4030:52ad1606d994
tag: tip
user: Rob Pike <r@golang.org>
date: Fri Nov 13 13:15:18 2009 -0800
summary: Explain why
The text was updated successfully, but these errors were encountered:
by azummo-google@towertech.it:
The text was updated successfully, but these errors were encountered: