LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 03-20-2009, 01:42 AM   #1
gr3ymatt3r
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
Question 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
 
Old 03-21-2009, 10:43 AM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
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.
 
  


Reply

Tags
api, network, programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control of Network Connections/network startup question Fedora 9 Gnome benkerndt Fedora 2 01-06-2009 08:14 PM
user space network driver api? jesshowe Programming 3 05-30-2008 03:22 PM
need help to iterate through PID's mcnkevin Programming 7 11-24-2007 06:08 PM
c: iterate an array of structs kpachopoulos Programming 2 08-15-2006 12:06 PM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 04:26 PM


All times are GMT -5. The time now is 09:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration