oedipuss
February 16th, 2007, 04:29 PM
What would be the correct or most useful way of binding a server socket in python?
When I bind with (socket.gethostname(), port) others can't connect to me, maybe because I'm behind a router, even though I've seen the above way suggested in some tutorials, but when I bind with ('',port) it works fine.
I suspect though that the empty string wouldn't work in other machines; that tutorial pointed out that it's binding only to localhost that way.. What's the best way to do it, so it works in general?
thanks =)
When I bind with (socket.gethostname(), port) others can't connect to me, maybe because I'm behind a router, even though I've seen the above way suggested in some tutorials, but when I bind with ('',port) it works fine.
I suspect though that the empty string wouldn't work in other machines; that tutorial pointed out that it's binding only to localhost that way.. What's the best way to do it, so it works in general?
thanks =)