LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 12: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, 09:43 AM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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



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 07:14 PM
user space network driver api? jesshowe Programming 3 05-30-2008 02:22 PM
need help to iterate through PID's mcnkevin Programming 7 11-24-2007 05:08 PM
c: iterate an array of structs kpachopoulos Programming 2 08-15-2006 11:06 AM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 03:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:10 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration