binding to localhost - slightly OT

Ajay abra9823 at mail.usyd.edu.au
Wed Sep 22 05:15:35 EDT 2004


hi!

I am making the following call on my PDA which has WLAN connectivity
>>>import socket
>>>socket.gethostbyname(socket.gethostname())
this prints 127.0.0.1
the PDA has an assigned IP address.
so if i go
UDPserversocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
UDPserversocket.bind((socket.gethostname(), LOCAL_SERVER_PORT))

this binds to the localhost instead of the assigned IP address. how can i
get it to bind to the assigned IP? i dont want to explicitly enter the IP
address into the bind call, since the IP may change.

thanks

cheers




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list