binding to localhost - slightly OT

Ajay abra9823 at
Wed Sep 22 05:15:35 EDT 2004


I am making the following call on my PDA which has WLAN connectivity
>>>import socket
this prints
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.



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

More information about the Python-list mailing list