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: Addr/LocalAddr on both TCPListener and UDPConn with wildcard address doesn't return proper address #3847

Closed
mikioh opened this issue Jul 21, 2012 · 6 comments

Comments

Projects
None yet
3 participants
@mikioh
Copy link
Contributor

commented Jul 21, 2012

What steps will reproduce the problem?
1. run attached tcplisten and udplisten
2.
3.

What is the expected output? What do you see instead?
% ./tcplisten 
net.Listen("tcp", ""): 0.0.0.0:0
net.ListenTCP("tcp", nil): 0.0.0.0:0
net.ListenTCP("tcp", &net.TCPAddr()): 0.0.0.0:52391

% ./udplisten 
net.ListenPacket("udp", ""): listen udp: missing address
net.ListenUDP("udp", nil): listen udp: missing address
net.ListenUDP("udp", &net.UDPAddr{}): 0.0.0.0:65359

Please use labels and text to provide additional information.

Attachments:

  1. tcplisten.go (581 bytes)
  2. udplisten.go (608 bytes)
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Jul 21, 2012

Comment 1:

What we need to fix this issue might be:
a) make it possible to listen with a bound address even if laddr is "" or nil,
b) allow to pass "" to net.ListenPacket("udp"),  nil to net.ListenUDP("udp").
@rsc

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2012

Comment 3:

c) avoid passing a nil as a parameter to ListenTCP, ListenUDP and ListenIP
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Oct 5, 2012

@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Nov 12, 2012

Comment 5:

https://golang.org/cl/6525048/

Status changed to Started.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2012

Comment 6:

This issue was closed by revision 677c6e6.

Status changed to Fixed.

@mikioh mikioh added fixed labels Nov 13, 2012

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1 label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 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.