473,383 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to switch from a Ethernet Adapter to another-LAN to WLAN?

39
I am trying to familiarize myself with a C++ application which has a bug.

I'd like to have the application connect to WLAN when LAN is not available and vice versa.

Basically, it fails to connect to WLAN when LAN cable is plugged out. Is there a auto mechanism like Network manager which takes care of this? Or do i have to look after this in the code myself? If latter, any tips on how to do it?

Any help is appreciated.

Thanks!
Oct 1 '07 #1
10 3080
Colloid Snake
144 100+
Is the application written so that it is supposed to? Are there distinct connections on the box that are being labeled as LAN and WAN (ie, is the app functioning correctly, and can the app function correctly)? If yes to both, I would think the issue is in the program itself.
Oct 1 '07 #2
ycinar
39
Is the application written so that it is supposed to? Are there distinct connections on the box that are being labeled as LAN and WAN (ie, is the app functioning correctly, and can the app function correctly)? If yes to both, I would think the issue is in the program itself.
It is written so... but appearantly not functioning fine. I need to make it work.

There are indeed distinct LAN and WLAN connections.

I wonder where i can find some example code which looks after transferring the connection from LAN to WLAN.. Even learning how to establish a connection over LAN or WLAN should help as well.

Thanks for your help!
Oct 3 '07 #3
Colloid Snake
144 100+
If it is designed to do that, I would recommend looking at the code - my guess would be that it is in there.
Oct 3 '07 #4
ycinar
39
If it is designed to do that, I would recommend looking at the code - my guess would be that it is in there.
Thanks for your reply, yes the its the code i need to investigate.

I had some progression though. The question now is somewhat different: Say I have got two different Ethernet cards, one for LAN and one for WLAN. How could I determine which of the available connections is actively in use for my application?

Thanks!
Oct 4 '07 #5
sicarie
4,677 Expert Mod 4TB
Do a packet capture or windump on the interface while the program is running (and nothing else, just to keep you from getting confused).
Oct 4 '07 #6
ycinar
39
Do a packet capture or windump on the interface while the program is running (and nothing else, just to keep you from getting confused).
I think I need to make a clarification:

say you have got 2 ethernet cards, Wireless and Wire. Program reads these and makes a connection with one of them, say Wire. Then you plug out your cable and would like your application make a new connection with Wireless. then you plug back in your LAN cable and something happens to your Wireless then you would like to make new connection with your LAN again.

BUT

While you are connected using LAN then Wireless is disabled, the program should do nothing at this case - no need to take any action as you were not using Wireless anyway, simple is that.

So the question is during the execution of the code, how can I determine which ethernet is being used? Is it the one in use or not?

Thanks again!
Oct 4 '07 #7
sicarie
4,677 Expert Mod 4TB
You can see them in the command line by opening it up (run 'cmd' or opening a terminal window) and then executing the 'ipconfig /all' command on windows or the 'ifconfig' command on Linux. You will see your interfaces as your computer sees them. From here, it seems you need API help with whatever OS you are using to use that to find the interface handles.
Oct 4 '07 #8
ycinar
39
You can see them in the command line by opening it up (run 'cmd' or opening a terminal window) and then executing the 'ipconfig /all' command on windows or the 'ifconfig' command on Linux. You will see your interfaces as your computer sees them. From here, it seems you need API help with whatever OS you are using to use that to find the interface handles.

The program can read the ethernet info and make the relevant the connections if they are enabled/plugged etc.

I need to implement the fail over logic for the interfaces. Say if an interface is down for some reason (cable plugged out, disabled, etc), in that case I just want to detect if the the down interface is the one i was using for connection to the server.

Thanks guys!
Oct 4 '07 #9
ycinar
39
Can anyone suggest on how to figure out if the LAN cable is connected or not using C++? Like an listener?
Oct 5 '07 #10
Colloid Snake
144 100+
What OS are you using?
Oct 23 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: | last post by:
Hi, I need to read a big CSV file, where different fields should be converted to different types, such as int, double, datetime, SqlMoney, etc. I have an array, which describes the fields and...
1
by: dalewz | last post by:
Hi, I am thinking to use C# in MS VS.net to support GUI and Ethernet communication. I heard that this is doable by opening a socket. Could sb share more info on this? Thanks. -Dale
8
by: Edison Abarca Tapia | last post by:
Hi: I need change MAC(nic) Address. I help me pleaseeeee... thanks, Edison
2
by: simon | last post by:
I use my functions to create adapter and fill dataSet: funkcije.createAdapter("c_CPOSkupaj", False, myParams).Fill(ds, "brezReklam") If I use this function another time to fill dataSet with...
3
by: Bob Greschke | last post by:
There is a lot to stuff that seems to skirt around this issue (most of which has to do with finding your IP address), but I can't find anything that explains how to write a client that (in my case)...
13
by: KiwiGenie | last post by:
I am trying to connect to the internet using a USB Ethernet adapter. It installs but won't connect to my dsl modem. The ethernet light on the modem doesn't even light up, though the same cable works...
1
by: kavok | last post by:
I am writing a software that needs to sniff packets in the network (raw ethernet) and also, with another thread send regular UDP packets with the common socket API's. However, when the RAW...
0
by: alexia.bee | last post by:
Hi All, Any know why NetworkInterfaceType returns Ethernet type for Wireless adapter and not Wireless80211? thanks.
2
by: pugazhraj | last post by:
hai experts, iam new to network field and in our office ethernet switch board is not working .could any one know what are the possiblities for the problem and plz help me to...
3
by: jh3530 | last post by:
Hello, my apologies for the lame question, but I can't seem to figure this one out. I was recently given a laptop from my inlaws that is running windows 98. I wanted to get internet access on it,...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.