I have a server with two different network interfaces, each with a different IP address. How can I create a socket so it'll go out a specific IP address?
I'd prefer a python example, but the question is language agnostic, so shoot away.
EDIT: Please don't give me "You can't" as an answer. I mean, it is a computer. I can do anything I like to it, for example - I can programatically disable the one interface I don't want on the fly. I'm looking for something prettier.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…