views:

2

answers:

0

I have the requirement to make connections from server that actually plays a client role while using different IP addresses depending on call type policy.

Details:
1. The OS is Linux (Debian).
2. There is 1 network card + 3 aliases
3. The call activity from my server may looks like:

    My server ('client' role) calls:
         * call A (using IP: 10.10.93.85) 
         * call B (using IP: 10.10.93.86) 
         * call C (using IP: 10.10.93.87) 
         * call D (using IP: 10.10.93.88) 

I usually used BSD socket for client side as follow: socket -> connect -> send/receive -> shutdown -> close

The 'bind' is used for server side, IMHO. I'm pretty sure that solution exists. Can you please give me an advice where to begin to look? What is best practice for deploying sockets with specific IP address?

Thank you in advance!