How set the source IP adress
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Fri Oct 27 19:28:46 CEST 2006
Maksim Kasimov wrote:
> how to set source ip-address when do __socket.connect((host, port))
> on a machine that have a several ip-adresses?
> many thanks for advice.
> __socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> __socket.connect((host, port))
sock.connect ( ('18.104.22.168', 9999) )
i.e. just put the ip address as string parameter into the connect address tuple
(where you wrote: host)
More information about the Python-list