From: Raghuram D. <dra...@gm...> - 2007-07-26 21:03:51
|
On 7/26/07, Alan Kennedy <jyt...@xh...> wrote: > You will find the behaviour you expect if you actually use the socket, > like so > > Jython 2.2rc3 on java1.4.2_13 > Type "copyright", "credits" or "license" for more information. > >>> import socket > >>> serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > >>> serv.bind ( ('localhost', 0) ) > >>> serv.listen() > >>> serv.getsockname() > ('127.0.0.1', 1068) Ok. This makes sense and should be fine in most cases. I actually tried binding to port 0 as I wanted to see if that approach can be used in test_socket.py (instead of using a static port like 50007). I will follow up in that thread. |