New submission from Bill Janssen:

It would be useful to have a way to determine whether a socket is or is 
not already bound to a local port (i.e., has had "bind" or "connect" 
called on it).  It's tempting to call socket.socket.getsockname(), but 
the behavior of this method is essentially undefined (i.e., it's 
whatever the underlying platform feels like doing, and there seem to be 
no constraints on that -- Unix systems typically return what seems to be 
someone's idea of a null address, while Windows systems currently raise 
an exception.).  So an extension API is needed to probe this state.

Suggest adding a method "is_bound" which returns a boolean.

----------
messages: 55494
nosy: janssen
severity: normal
status: open

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1062>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to