Message6672

Author irmen
Recipients irmen
Date 2011-10-12.22:29:04
SpamBayes Score 2.6606648e-08
Marked as misclassified No
Message-id <1318458545.27.0.982174992891.issue1806@psf.upfronthosting.co.za>
In-reply-to
Content
This is caused by the fact that the socket object doesn't have a sock_impl yet. That is only constructed later (in the listen method). Before that, getsockname() uses a meaningless hardcoded name and portnumber ("",0).

I've looked into it a bit and there doesn't seem an obvious way to fix the creation order of the sock_impl, because of the way Java's Socket objects are implemented (you have to pass the listen backlog size to the bind method, there doesn't seem to be a separate listen method).
However: IMO the getsockname method should create a sock_impl if it doesn't exist yet, with a 'guessed' listen backlog size (probably the default, 50) and return a sensible addresss+port, rather than the current behavior where a useless name+port is returned.
Thoughts?
History
Date User Action Args
2011-10-12 22:29:05irmensetmessageid: <1318458545.27.0.982174992891.issue1806@psf.upfronthosting.co.za>
2011-10-12 22:29:05irmensetrecipients: + irmen
2011-10-12 22:29:05irmenlinkissue1806 messages
2011-10-12 22:29:04irmencreate