UWNetworksLab / freedom

Embracing a distributed web
13 stars 4 forks source link

add getInfo method #55

Closed trevj closed 10 years ago

trevj commented 10 years ago

So, when you call bind with port zero the system will choose a free port for you. Turns out that's pretty handy for some stuff I'm working on. This surfaces the getInfo call, with which you can query the bound port (and address).

Open to suggestions on whether it's better to have separate getPort() and getAddress() calls vs. this catch-all getInfo().

willscott commented 10 years ago

@Paul-E - you're the one who has looked at firefox's socket stuff. Changes we should be making to this interface at this point to support that?

coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling f4aa6baa7f859e7e385315ea833d3435ea9acdf3 on yangoon-core.udpsocket-getinfo into 4cd3b855d2e1ddbfc4347315f3da6fa8c25fa9db on master.

willscott commented 10 years ago

Anyway, we have this in the socket API as well, so it shouldn't be a problem :+1:

trevj commented 10 years ago

Great. Thanks Will. Yeah, in this case I didn't see any need to stray from the standard socket API.