LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   API to iterate over available network connections (https://www.linuxquestions.org/questions/programming-9/api-to-iterate-over-available-network-connections-713023/)

gr3ymatt3r 03-20-2009 12:42 AM

API to iterate over available network connections
 
Dear All,

Is anybody aware of some API which lets me iterate over the network connections currently active on the Linux box?

I have this scenario:
My laptop running fedora is connected simultaneously through

1. Ethernet
2. WLAN

My program communicates over UDP with other computer on the network. Now I want my program to be in control of which network connection is used for communication.

Thanks.

Regards,
Ashay

dwhitney67 03-21-2009 09:43 AM

Find the IP address assigned to the device you want to use, then bind() your port. Typically this is done by the server.

For the client application, it can perform a connect(), and then rely on send() to send messages. Alternatively, the client can use a sendto() and provide the server's IP address and port number.


All times are GMT -5. The time now is 07:31 PM.