tcp client socket bind problem

natambu at gmail.com natambu at gmail.com
Mon Mar 10 01:21:59 EDT 2008


I have a linux box with multiple ip addresses. I want to make my
python client connect from one of the ip addresses. Here is my code,
no matter what valid information I put in the bind it always comes
from the default ip address on the server. Am I doing something wrong?


-------------
#!/usr/bin/python

import socket

host = "server"
port = 1190

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

sock.bind(("<ipalias>",0))
sock.connect((host, port))
-------------





More information about the Python-list mailing list